ID: 43227 Updated by: j...@php.net Reported By: baco at infomaniak dot ch Status: Closed Bug Type: mbstring related Operating System: Linux Debian PHP Version: 5.2.5 Assigned To: hirokawa New Comment:
This was fixed. Previous Comments: ------------------------------------------------------------------------ [2008-07-13 01:37:23] hirok...@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi ------------------------------------------------------------------------ [2008-07-11 21:32:22] j...@php.net Assigned to mbstring maintainer. ------------------------------------------------------------------------ [2008-02-25 13:31:02] baco at infomaniak dot ch As workaround try to force mbstring.func_overload = 0 in your php.ini and use this patch. PHP5 unix_mbstring_func_overload.patch --- ext/mbstring/mbstring.c 2007-09-24 13:51:36.000000000 +0200 +++ ext/mbstring/mbstring.c 2007-12-04 18:00:10.023564681 +0100 @@ -765,8 +765,8 @@ PHP_INI_ENTRY("mbstring.script_encoding", NULL, PHP_INI_ALL, OnUpdate_mbstring_script_encoding) #endif /* ZEND_MULTIBYTE */ PHP_INI_ENTRY("mbstring.substitute_character", NULL, PHP_INI_ALL, OnUpdate_mbstring_substitute_character) - STD_PHP_INI_ENTRY("mbstring.func_overload", "0", PHP_INI_SYSTEM | - PHP_INI_PERDIR, OnUpdateLong, func_overload, zend_mbstring_globals, mbstring_globals) + STD_PHP_INI_ENTRY("mbstring.func_overload", "0", + PHP_INI_SYSTEM, OnUpdateLong, func_overload, zend_mbstring_globals, mbstring_globals) STD_PHP_INI_BOOLEAN("mbstring.encoding_translation", "0", PHP_INI_SYSTEM | PHP_INI_PERDIR, OnUpdate_mbstring_encoding_translation, PHP4 --- ext/mbstring/mbstring.c 2007-04-04 17:28:18.000000000 +0200 +++ ext/mbstring/mbstring.c 2007-12-04 18:05:29.363559316 +0100 @@ -815,8 +815,8 @@ PHP_INI_ENTRY("mbstring.script_encoding", NULL, PHP_INI_ALL, OnUpdate_mbstring_script_encoding) #endif /* ZEND_MULTIBYTE */ PHP_INI_ENTRY("mbstring.substitute_character", NULL, PHP_INI_ALL, OnUpdate_mbstring_substitute_character) - STD_PHP_INI_ENTRY("mbstring.func_overload", "0", PHP_INI_SYSTEM | - PHP_INI_PERDIR, OnUpdateInt, func_overload, zend_mbstring_globals, mbstring_globals) + STD_PHP_INI_ENTRY("mbstring.func_overload", "0", + PHP_INI_SYSTEM, OnUpdateInt, func_overload, zend_mbstring_globals, mbstring_globals) STD_PHP_INI_BOOLEAN("mbstring.encoding_translation", "0", PHP_INI_SYSTEM | PHP_INI_PERDIR, OnUpdate_mbstring_encoding_translation, ------------------------------------------------------------------------ [2008-02-25 13:18:00] lip at lip dot net dot ua I think these bugs are similar. http://bugs.php.net/bug.php?id=44237 ------------------------------------------------------------------------ [2007-11-09 16:03:14] baco at infomaniak dot ch Description: ------------ eregi() produce random errors like "function.mb-eregi: mbregex compile err: premature end of regular expression in" when used with special chars like accents. N.B. On the web you can found a lot of reports of this issue. Some post suggests forcing mbstring.func_overload = 0 but it doesn't work for me. If Apache1 is restarted the error doesn't come anymore before an amount of time and request. $ GET http://localhost/test.php ok $ GET http://localhost/test.php ok $ GET http://localhost/test.php <br /> <b>Warning</b>: mb_eregi() [<a href='function.mb-eregi'>function.mb-eregi</a>]: mbregex compile err: premature end of regular expression in <b>/home/www/ca8b72beb934995c1afb34e1a3ceb893/web/test.php</b> on line <b>2</b><br /> $ GET http://localhost/test.php <br /> <b>Warning</b>: mb_eregi() [<a href='function.mb-eregi'>function.mb-eregi</a>]: mbregex compile err: premature end of regular expression in <b>/home/www/ca8b72beb934995c1afb34e1a3ceb893/web/test.php</b> on line <b>2</b><br /> $ GET http://localhost/test.php <br /> <b>Warning</b>: mb_eregi() [<a href='function.mb-eregi'>function.mb-eregi</a>]: mbregex compile err: premature end of regular expression in <b>/home/www/ca8b72beb934995c1afb34e1a3ceb893/web/test.php</b> on line <b>2</b><br /> $ GET http://localhost/test.php ok $ GET http://localhost/test.php ok ... Reproduce code: --------------- <?php if (eregi("cité", "electricité")) { echo "ok\n"; } ?> Expected result: ---------------- OK Actual result: -------------- <br /> <b>Warning</b>: mb_eregi() [<a href='function.mb-eregi'>function.mb-eregi</a>]: mbregex compile err: premature end of regular expression in <b>/home/www/ca8b72beb934995c1afb34e1a3ceb893/web/test.php</b> on line <b>2</b><br /> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43227&edit=1