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

Request #15630 Make an isToken() method that encapsulates the regular expression
Submitted: 2009-01-13 22:01 UTC Modified: 2009-01-23 13:07 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  


 [2009-01-13 22: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 17:03 UTC] avb (Alexey Borzov)
I think I'd rather make regexps from setHeader() / setMethod() and addCookie() class constants. Sounds OK?
 [2009-01-16 19:56 UTC] gauthierm (Michael Gauthier)
Sounds to me like a good way to do it.
 [2009-01-23 13: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.