Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.6.0

Request #15630 Make an isToken() method that encapsulates the regular expression
Submitted: 2009-01-14 03:01 UTC
From: gauthierm Assigned: avb
Status: Closed Package: HTTP_Request2 (version 0.2.0)
PHP Version: 5.2.6 OS: Irrelevant
Roadmaps: 0.3.0    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 46 + 30 = ?

 
 [2009-01-14 03:01 UTC] gauthierm (Michael Gauthier)
Description: ------------ That is all. Test script: --------------- protected function isToken($string) { return preg_match('![\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]!', $string) === 0); }

Comments

 [2009-01-16 22:03 UTC] avb (Alexey Borzov)
I think I'd rather make regexps from setHeader() / setMethod() and addCookie() class constants. Sounds OK?
 [2009-01-17 00:56 UTC] gauthierm (Michael Gauthier)
Sounds to me like a good way to do it.
 [2009-01-23 18:07 UTC] avb (Alexey Borzov)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.