php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44237 mbstring.func_overload
Submitted: 2008-02-24 22:03 UTC Modified: 2008-03-19 01:00 UTC
Votes:11
Avg. Score:4.6 ± 0.6
Reproduced:9 of 9 (100.0%)
Same Version:2 (22.2%)
Same OS:3 (33.3%)
From: lip at lip dot net dot ua Assigned:
Status: No Feedback Package: Apache2 related
PHP Version: 5.2.5 OS: Debian 4.0
Private report: No CVE-ID: None
 [2008-02-24 22:03 UTC] lip at lip dot net dot ua
Description:
------------
PHP 5.2.5
Apache/2.2.8

If I use mbstring.func_overload in .htaccess 
other virtual-host doesn't work.

For example:
<VirtualHost *:80>
DocumentRoot /var/www/php1
ServerName php1.net
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /var/www/php2
ServerName php2.net
</VirtualHost>

in /var/www/php1/.htaccess
php_value mbstring.func_overload 6

In this situation php2.net/mb.php doesn't work when I refresh few
times php1.net/mb.php and php2.net/mb.php



Reproduce code:
---------------
--mb.php---
<?php
$re0 = '(^|(\\\\\\\\)+|[^\])';
$dbname_to_test = 'galaD';

if  (ereg($re0,$dbname_to_test))
{
var_dump ($dbname_to_test);
}
?>

Expected result:
----------------
galaD

Actual result:
--------------
Warning:  mb_ereg() function.mb-ereg: mbregex compile err: premature end of char-class in /var/www/php2/mb.php

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-24 22:23 UTC] lip at lip dot net dot ua
Expected result:
----------------
php1.net - Warning:  mb_ereg() function.mb-ereg: mbregex compile err: premature end of char-class in /var/www/php2/mb.php

php2.net - galaD

Actual result:
--------------
php1.net - Warning
php2.net - Warning
 [2008-02-25 13:29 UTC] 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-03-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2008-05-20 14:15 UTC] unixro at gmail dot com
Bug still replicates on php5.2.6
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 20:01:29 2024 UTC