|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49238 mbstring.func_overload cannot be set in htaccess
Submitted: 2009-08-12 17:14 UTC Modified: 2009-08-13 09:36 UTC
From: tony at marston-home dot demon dot co dot uk Assigned:
Status: Not a bug Package: mbstring related
PHP Version: 5.2.10 OS: Windows XP
Private report: No CVE-ID: None
 [2009-08-12 17:14 UTC] tony at marston-home dot demon dot co dot uk
My PHP.INI file contains the following:
;mbstring.internal_encoding EUC-JP
;mbstring.func_overload = 0

My htaccess file contains the following:
php_value mbstring.internal_encoding "UTF-8"
php_value mbstring.func_overload 2

When I run phpinfo() it shows that the value for mbstring.internal_encoding has been changed, but the value for mbstring.func_overload is still 0. When I try to run strtoupper() on a string which contains a multibyte character the result is incorrect.

Reproduce code:
$upper = strtoupper('w?rzburg');
if ($upper != 'W?RZBURG') {
    echo 'test failed!';
} // if

Expected result:
I expect the above code to work without the 'test failed!' message.

Actual result:
$upper contains 'W?RZBURG'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-12 18:22 UTC]
It can only be set in php.ini. Not a bug. See also bug #49189 and next 
time: SEARCH first before submitting another bug about same issue.
 [2009-08-12 18:42 UTC] tony at marston-home dot demon dot co dot uk
I DID search first on 'MBstring issues', but bug #49189 was catalogued as a documentation issue, so how was I to spot it?

Bug #49189 refers to bug #43227 as "proof" (supposedly) that mbstring.func_overload was changed from PHP_INI_PERDIR to PHP_INI_SYSTEM, but it says no such thing. It simply says "try mbstring.func_overload = 0 in your php.ini as a workaround"
 [2009-08-13 09:00 UTC]
Yes, the bug report itself is vague, but it was also mentioned in the commit message that changes this.. :)
 [2009-08-13 09:19 UTC] tony at marston-home dot demon dot co dot uk
There was nothing about this in the contents of the patch as it still shows that 'func_overload' is linked to PHP_INI_PERDIR, so it would appear that the decision was made "behind the scenes", in secret, without telling anyone. There was no mention of this in the release notes, and the documentation has NEVER been updated to reflect this decision even after 6 months has passed.

This feature has been available since version 4.2.0, now suddenly it does not work. If my site is on a shared server, meaning that I cannot change the contents of either php.ini or httpd.conf, and func_overload is set to 0, then how on earth can I turn it on?
 [2009-08-13 09:36 UTC] tony at marston-home dot demon dot co dot uk
It should also be pointed out that if func_overload is turned ON globally then phpMyAdmin, the most widely used administration program for MySQL databases, will issue a message warning about possible data corruption. That is why the decision to remove the PHP_INI_PERDIR option is a bad one and should be reversed.
 [2009-09-11 06:08 UTC]
Automatic comment from SVN on behalf of torben
Log: Note that mbstring.func_overload is once again PHP_INI_SYSTEM only.
Addresses bugs #49238, #43227, and #49189.

This really should have been mentioned in the release notes for 5.2.7
and 5.3.0.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 21:01:29 2024 UTC