#43227 [Com]: eregi() mbregex compile err: premature end of regular expression in
ID: 43227 Comment by: lip at lip dot net dot ua Reported By: baco at infomaniak dot ch Status: Open Bug Type: mbstring related Operating System: Linux Debian PHP Version: 4.4.7 New Comment: I think these bugs are similar. http://bugs.php.net/bug.php?id=44237 Previous Comments: [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 / bWarning/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 b2/bbr / $ GET http://localhost/test.php br / bWarning/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 b2/bbr / $ GET http://localhost/test.php br / bWarning/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 b2/bbr / $ 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 / bWarning/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 b2/bbr / -- Edit this bug report at http://bugs.php.net/?id=43227edit=1
#27421 [Com]: mbstring.func_overload set in .htaccess becomes global
ID: 27421 Comment by: lip at lip dot net dot ua Reported By: php at strategma dot bg Status: No Feedback Bug Type: mbstring related Operating System: Slackware 9.1 kernel: 2.4.22 PHP Version: 4.3.4 New Comment: I also have this problem. PHP 5.2.5 Apache/2.2.8 If I use mbstring.func_overload in .htaccess other virtualhosts not work For example: VirtualHost *:80 DocumentRoot /var/www/phpmyadmin AddHandler cgi-script .cgi AddHandler cgi-script .pl ServerName n.com.net /VirtualHost VirtualHost *:80 DocumentRoot /var/www/db ServerName db.net /VirtualHost in /var/www/db/.htaccess php_value mbstring.func_overload 6 In this situation phpmyadmin doesnt work when I refresh few times db.net Previous Comments: [2008-01-17 13:35:30] mihau at great dot net dot pl I'm still experiencing this bug. On apache 2.0.59 with php 5.2.4, as well as php 4.4.x. It looks like mbstring.func_overload setting in .htaccess affects other virtualhosts and directories. I've tried with these in httpd.conf: IfModule prefork.c MaxRequestsPerChild 10 /IfModule It works as expected for site A until I enter site B with mbstring.func_overload in .htaccess. Site B works as expected. Then i come back to site A and see unexpected results. I hit refresh few times and results back to normal. It looks like one request affects all other requests for specified child. When apache kill it after MaxRequestPerChild and spawn new child everything is working fine, until site B is requested. Is this bug somehow related to #43677? With one exception: ini_get(mbstring.func_overload) returns correct values - I mean values from config files. [2007-01-18 09:29:39] info at bert-jan dot com I've tried it on another server running Debian unstable with PHP 5.2.0-8 on Apache 2.2.3 both installed with apt-get and the same issue is reproducible here too. [2007-01-17 21:57:23] info at bert-jan dot com FYI: I'm running Slamd64 (Slackware x86-64) with Apache and PHP installed from source. Apache: ./configure \ --enable-ssl \ --with-ssl \ --enable-proxy \ --enable-proxy-connect \ --enable-proxy-ftp \ --enable-proxy-http \ --enable-rewrite \ --enable-deflate \ --enable-so \ PHP: ./configure \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-mysql=/usr/local/mysql/ \ --with-zlib \ --with-gd \ --with-jpeg-dir \ --with-png-dir \ --with-freetype-dir \ --enable-ftp \ --with-bz2 \ --with-gzip \ --with-openssl \ --enable-shmop \ --enable-posix \ --enable-pcntl \ --enable-sysvsem \ --enable-sysvshm \ --enable-iconv \ --with-mysqli=/usr/local/mysql/bin/mysql_config \ --enable-mbstring \ --enable-shmop \ --enable-soap \ --enable-memory-limit [2007-01-17 21:41:53] info at bert-jan dot com I'm having this exact same issue on PHP 5.1.6 on Apache 2.0.59. Putting the mbstring.* settings in the VirtualHost-directive or in .htaccess doesn't seem to make a difference. The settings are 'leaked' to other vhosts who start to randomly malfunction and report errors like Warning: mb_strrpos() [function.mb-strrpos]: Unknown encoding 6 in /home/bertjan/public_html/functions.php on line 307 As stated in the other comments, the erroneous behaviour isn't consistent. Sometimes it works but more often it doesn't. The trouble is quite evident in e.g. Squirrelmail or phpMyAdmin. [2006-11-17 15:02:35] christophe at saout dot de I'm still seing a similar problem in PHP 4.4.4. The site has globally turned on mbstring.func_overload in php.ini. When turning it off in a .htaccess for a specific directory, the behaviour experienced by the scripts in that directory becomes random. Sometimes it works as expected (especially after a fresh start of apache), but most of the time the script is using the overloaded mbstring functions e.g. for substr, even though ini_get(mbstring.func_overload) returns 0. It looks like the save/restore in the mbstring module somehow gets confused and leaks overloaded functions between apache requests. Assuming this is a variant of the bug experienced by the original bug author, I'm posting this here and requesting a re-opening. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/27421 -- Edit this bug report at http://bugs.php.net/?id=27421edit=1
#44237 [NEW]: mbstring.func_overload
From: lip at lip dot net dot ua Operating system: Debian 4.0 PHP version: 5.2.5 PHP Bug Type: Apache2 related Bug description: mbstring.func_overload 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 -- Edit bug report at http://bugs.php.net/?id=44237edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44237r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44237r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44237r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44237r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44237r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44237r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=44237r=needscript Try newer version:http://bugs.php.net/fix.php?id=44237r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44237r=support Expected behavior:http://bugs.php.net/fix.php?id=44237r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44237r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44237r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44237r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44237r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44237r=dst IIS Stability:http://bugs.php.net/fix.php?id=44237r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44237r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44237r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44237r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=44237r=mysqlcfg
#44237 [Opn]: mbstring.func_overload
ID: 44237 User updated by: lip at lip dot net dot ua Reported By: lip at lip dot net dot ua Status: Open Bug Type: Apache2 related Operating System: Debian 4.0 PHP Version: 5.2.5 New Comment: 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 Previous Comments: [2008-02-24 22:03:13] 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 -- Edit this bug report at http://bugs.php.net/?id=44237edit=1