From:             php dot net at waisse dot org
Operating system: gentoo linux
PHP version:      5.2.6
PHP Bug Type:     PCRE related
Bug description:  classes no more work with PHP 5.2.6 preg_* functions, but 
pcre support classes

Description:
------------
 Using classes in preg_* functions worked before 5.2.6
 After upgrading to 5.2.6 classes like [:space:] no more work
 I had to replace all [:class:] with things like \s


Reproduce code:
---------------
 the regular expression :
list($header) = preg_split(',<(item|entry)[:[:space:]>],', $rss, 2);

 worked before PHP 5.2.6

 no more working now, I had to change this to :
list($header) = preg_split(',<(item|entry)[:\s>],', $rss, 2);
 and it works again.


Expected result:
----------------
 see http://www.pcre.org/pcre.txt

 it says that pcre supports classes 
( POSIX CHARACTER CLASSES
 Perl supports the POSIX notation for character classes. This uses names
enclosed  by  [: and :] within the enclosing square brackets. PCRE also
supports this notation. )

 so the classes should work with PHP 5.2.6 pcre ( preg_* fucntions )
 this always worked before and thousands of websites are using them.

 The above code is sandard spip ( http://spip.net ) code for years and
this feature change in PHP 5.2.6 makes that all spip websites no more work
with PHP 5.2.6.

 Probably many other CMS will have the same problem.

 Could anyone confirm that this is a PHP 5.2.6 pcre implementation bug
before we try to insert a workaround in spip code ?

 The regular expression seems ok since this works after replacing
[:space:] with \s .


Actual result:
--------------
Warning: preg_split() [function.preg-split]: Compilation failed: POSIX
named classes are supported only within a class at offset 13 in
/www/spanish.feeder.ww7.be/html/ecrire/inc/syndic.php on line 145

Warning: preg_match_all() [function.preg-match-all]: Compilation failed:
POSIX named classes are supported only within a class at offset 14 in
/www/spanish.feeder.ww7.be/html/ecrire/inc/syndic.php on
                  line 166


-- 
Edit bug report at http://bugs.php.net/?id=44928&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44928&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44928&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44928&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44928&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44928&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44928&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44928&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44928&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44928&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44928&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44928&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44928&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44928&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44928&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44928&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44928&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44928&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44928&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44928&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44928&r=mysqlcfg

Reply via email to