#46174 [Opn->Fbk]: _pcre_utt_names is overridden from libpcre.so and results in \p match failure
ID: 46174
Updated by: nlopess@php.net
Reported By: pageexec at freemail dot hu
-Status: Open
+Status: Feedback
Bug Type: PCRE related
Operating System: linux
PHP Version: 5.2.6
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.3-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.3-win32-installer-latest.msi
I believe this is fixed in latest cvs.
Previous Comments:
------------------------------------------------------------------------
[2008-09-25 16:18:02] pageexec at freemail dot hu
i guess the simple fix is to add
#define _pcre_utt_names php__pcre_utt_names
to main/php_compat.h.
------------------------------------------------------------------------
[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
Thread (5 messages)