ID:               44928
 Updated by:       [EMAIL PROTECTED]
 Reported By:      php dot net at waisse dot org
-Status:           Open
+Status:           Bogus
 Bug Type:         PCRE related
 Operating System: gentoo linux
 PHP Version:      5.2.6
 New Comment:

This is a PCRE library issue, not the PHP extension.
Probably related to item 23 in http://pcre.org/changelog.txt


Previous Comments:
------------------------------------------------------------------------

[2008-05-06 14:28:51] php dot net at waisse dot org

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 this bug report at http://bugs.php.net/?id=44928&edit=1

Reply via email to