|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40441 mbstring function overloading turns on randomly
Submitted: 2007-02-12 08:48 UTC Modified: 2007-02-12 10:15 UTC
From: dmitry at rsl dot ru Assigned:
Status: Not a bug Package: mbstring related
PHP Version: 5.2.1 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: dmitry at rsl dot ru
New email:
PHP Version: OS:


 [2007-02-12 08:48 UTC] dmitry at rsl dot ru
Just like with exception that mbstring.func_overload is set to 2 globaly, but disabled for virtualhost. This leads mbstring function overloading to be enabled randomly.
Try to visit and then refresh several times. is the same script plus phpinfo();

Reproduce code:
<? if (strstr('','')) { } ?>

Expected result:
nothing expected

Actual result:
Warning:  mb_strstr() [function.mb-strstr]: Empty delimiter. in q.php on line 1
-- or  --
nothing (as expected)
-- or  --
Warning:  strstr() [function.strstr]: Empty delimiter. in /home/html/ on line 1 (rare)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-12 08:56 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

 [2007-02-12 09:13 UTC] dmitry at rsl dot ru
how I can provide more information than phpinfo() at
 [2007-02-12 09:21 UTC]
Duplicate of bug #38670.
 [2007-02-12 09:46 UTC] dmitry at rsl dot ru
I'm not sure that this is duplicate of bug #38670, since we not using safe mode at all. I think that this bug is a kind of

The problem is that mbstring.function_overload is set to 0 for apache's virtualhost (while mbstring.function_overload = 2 in php.ini), but strstr (and probably others) still overloaded, not always but randomly. No matter if strstr got overloaded or not, ini_get('mbstring.function_overload') is equal to 0 for this virtualhost.
 [2007-02-12 09:52 UTC]
This Apache2-related problem is described in details in bug #38670. 

>since we not using safe mode at all
safe_mode is just an INI setting, as well as mbstring.func_overload.
 [2007-02-12 10:10 UTC] dmitry at rsl dot ru
Does your answer mean that any php_value option in .htaccess could be randomly ignored by php when it is built as apache2 module?
 [2007-02-12 10:15 UTC]
My answer means that if you set/unset INI values between virtualhosts, Apache may not reinitialize environment betwene requests.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Feb 24 09:01:31 2024 UTC