ID: 46174
Comment by: pageexec at freemail dot hu
Reported By: pageexec at freemail dot hu
Status: Open
Bug Type: PCRE related
Operating System: linux
PHP Version: 5.2.6
New Comment:
i guess the simple fix is to add
#define _pcre_utt_names php__pcre_utt_names
to main/php_compat.h.
Previous Comments:
------------------------------------------------------------------------
[2008-09-25 16:13:04] pageexec at freemail dot hu
Description:
------------
the pcre extension contains a copy of some specific version of libpcre,
with most of the names prefixed with php_ except for _pcre_utt_names
which is not prefixed. this means that if a libphp user such as apache2
also happens to load libpcre (mine's directly linked against it so it
loads before libphp), the symbols from the latter may override
_pcre_utt_names and libphp will use the wrong names table when analyzing
\p and \P (the indices would come from php__pcre_utt which is specific
for the _pcre_utt_names table contained in the pcre extension).
Reproduce code:
---------------
preg_match_all("/\pL/u", "php", $matches);
print_r($matches);
Expected result:
----------------
Array
(
[0] => Array
(
[0] => p
[1] => h
[2] => p
)
)
Actual result:
--------------
Warning: preg_match_all() [function.preg-match-all]: Compilation
failed: unknown property name after \P or \p at offset 3 in <test.php>
on line <x>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46174&edit=1