# mb_string.func_overload as secretly beeb changed from PERDIR to SYSTEM

- Thread: https://externals.io/message/45544
- Original archive: https://news-web.php.net/php.internals/45544
- Started by Tony Marston on 2009-09-09T16:12:46+00:00
- Messages: 11
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #45544 — Tony Marston — 2009-09-09T16:12:46+00:00

URL: https://externals.io/message/45544#45544

I have reported this problem in http://bugs.php.net/bug.php?id=49238. It
would appear that this option, which was first made available in PHP 4.2.0,
has been silently dropped. Apparently the decision was made in order to fix
http://bugs.php.net/bug.php?id=43227, but nothing was explicitly stated in
the bug report, nor in any release notes, and the documentation still has
not been updated to reflect this change even after 6 months.

This causes a problem if your site is on a shared server and you don't have
access to either php.ini or httpd.conf. If this option is turned off by
default, then how do you turn it on? If it is on by default then how do you
turn it off? It needs to be turned off for phpMyAdmin otherwise it will
issue a message warning about possible data corruption.

Should this option be reinstated?

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

---

## #45545 — Tomas Kuliavas — 2009-09-09T17:43:20+00:00

URL: https://externals.io/message/45544#45545 · In reply to: #45544

2009.09.09 19:12 Tony Marston rašė:
> I have reported this problem in http://bugs.php.net/bug.php?id=49238. It
> would appear that this option, which was first made available in PHP
> 4.2.0,
> has been silently dropped. Apparently the decision was made in order to
> fix
> http://bugs.php.net/bug.php?id=43227, but nothing was explicitly stated in
> the bug report, nor in any release notes, and the documentation still has
> not been updated to reflect this change even after 6 months.
>
> This causes a problem if your site is on a shared server and you don't
> have
> access to either php.ini or httpd.conf. If this option is turned off by
> default, then how do you turn it on? If it is on by default then how do
> you turn it off? It needs to be turned off for phpMyAdmin otherwise it
> will issue a message warning about possible data corruption.

I think you can turn off mbstring overloading by setting internal mbstring
encoding to 'pass'. Instead of turning mbstring overloading on you should
use mbstring functions.

-- 
Tomas

---

## #45548 — Tony Marston — 2009-09-10T08:17:14+00:00

URL: https://externals.io/message/45544#45548 · In reply to: #45545

""Tomas Kuliavas"" <tokul@users.sourceforge.net> wrote in message 
news:40100.4e3f9432.1252518200.nsm@avilys.eik.lt...
> 2009.09.09 19:12 Tony Marston rase:
> > […]
>
> I think you can turn off mbstring overloading by setting internal mbstring
> encoding to 'pass'. Instead of turning mbstring overloading on you should
> use mbstring functions.

You THINK it can be turned off this way? That's not good enough. Does it 
actually work? Where is it documented?

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

---

## #45550 — Tomas Kuliavas — 2009-09-10T10:58:05+00:00

URL: https://externals.io/message/45544#45550 · In reply to: #45548

2009.09.10 11:17 Tony Marston rašė:
>
> ""Tomas Kuliavas"" <tokul@users.sourceforge.net> wrote in message
> news:40100.4e3f9432.1252518200.nsm@avilys.eik.lt...
> > […]
>
> You THINK it can be turned off this way? That's not good enough. Does it
> actually work? Where is it documented?

Works for me. See SquirrelMail functions/i18n.php set_up_language() function.

-- 
Tomas

---

## #45551 — Tony Marston — 2009-09-10T12:25:01+00:00

URL: https://externals.io/message/45544#45551 · In reply to: #45550

There is no set_up_language() function, and what has SquirrelMail got to do 
with PHP?

Unless you can point to some official documentation on the PHP web site your 
"advice" is totally unsubstantiated and virtually worthless.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

""Tomas Kuliavas"" <tokul@users.sourceforge.net> wrote in message 
news:1674.c316b4e9.1252580285.nsm@avilys.eik.lt...
> 2009.09.10 11:17 Tony Marston rase:
> > […]
>
> Works for me. See SquirrelMail functions/i18n.php set_up_language() 
> function.
>
> -- 
> Tomas

---

## #45552 — Dave Ingram — 2009-09-10T12:37:32+00:00

URL: https://externals.io/message/45544#45552 · In reply to: #45551

Tony Marston wrote:
> There is no set_up_language() function, and what has SquirrelMail got to do 
> with PHP?
>
> Unless you can point to some official documentation on the PHP web site your 
> "advice" is totally unsubstantiated and virtually worthless.
>   
He was referring to set_up_language() defined within SquirrelMail's
functions/i18n.php which contains:

        // mbstring.func_overload<>0 fix. See cvs HEAD comments.
        if ($squirrelmail_language != 'ja_JP' &&
            function_exists('mb_internal_encoding') &&
            check_php_version(4,2,0) &&
            (int)ini_get('mbstring.func_overload')!=0) {
            mb_internal_encoding('pass');
        }

among other things. This appears to be what he was referring to,
particularly the "mb_internal_encoding('pass');" call.


Dave

---

## #45553 — Dave Ingram — 2009-09-10T12:39:31+00:00

URL: https://externals.io/message/45544#45553 · In reply to: #45551

Tony Marston wrote:
> There is no set_up_language() function, and what has SquirrelMail got to do 
> with PHP?
>
> Unless you can point to some official documentation on the PHP web site your 
> "advice" is totally unsubstantiated and virtually worthless.
>
>   
As for hints in the documentation, see `mb_internal_encoding()` and the
comments for `mb_http_output()`, which mentions the 'pass' encoding type.


Dave

---

## #45554 — Tony Marston — 2009-09-10T13:46:32+00:00

URL: https://externals.io/message/45544#45554 · In reply to: #45553

You are missing the point. I'm not trying to set the encoding for any HTML 
output as that is handled differently. What I am concerned about is the 
func_overload option which, ever since PHP 4.2.0, we have been able to turn 
on or off using an htaccess directive on a PERDIR basis. Although neither 
the documentation nor the release notes have been changed the PERDIR option 
has disappeared and it is now set either on or off for the entire system and 
cannot be modified with any htaccess or ini_set directive.

So if func_overload is turned on, how do I turn it off? If it is turned off 
how do I turn it on?

Considering that phpMyAdmin does not like it to be turned on, this is not a 
trivial point.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

"Dave Ingram" <dave@dmi.me.uk> wrote in message 
news:4AA8F383.3040305@dmi.me.uk...
> Tony Marston wrote:
> > […]
> As for hints in the documentation, see `mb_internal_encoding()` and the
> comments for `mb_http_output()`, which mentions the 'pass' encoding type.
>
>
> Dave

---

## #45555 — Tomas Kuliavas — 2009-09-10T15:14:50+00:00

URL: https://externals.io/message/45544#45555 · In reply to: #45551

2009.09.10 15:25 Tony Marston rašė:
> There is no set_up_language() function, and what has SquirrelMail got to
> do with PHP?
>
> Unless you can point to some official documentation on the PHP web site
> your "advice" is totally unsubstantiated and virtually worthless.

This "advice" is the only advice that you got. :) It might be worthless,
but it comes from PHP script developer who specializes in
internationalization stuff and who had to make sure that his stuff works
without any .htaccess modifications in environment thrashed by
mbstring.func_overload.

Setting mbstring internal encoding to 'pass' fixed string length
evaluation issues in code which worked with random 8bit strings. Those
random strings store encoded passwords and any data corruption would
result authentication error. ereg and mail overrides were not tested,
because code rarely uses ereg functions and does not use PHP `mail()`.

Thanks to Dave for looking up the code I was referring too.

-- 
Tomas

---

## #45556 — Jani Taskinen — 2009-09-10T16:25:10+00:00

URL: https://externals.io/message/45544#45556 · In reply to: #45554

> You are missing the point. I'm not trying to set the encoding for any HTML
> output as that is handled differently. What I am concerned about is the
> func_overload option which, ever since PHP 4.2.0, we have been able to turn
> on or off using an htaccess directive on a PERDIR basis. Although neither
> the documentation nor the release notes have been changed the PERDIR option
> has disappeared and it is now set either on or off for the entire system and
> cannot be modified with any htaccess or ini_set directive.
>
> So if func_overload is turned on, how do I turn it off? If it is turned off
> how do I turn it on?
>
> Considering that phpMyAdmin does not like it to be turned on, this is not a
> trivial point.

Simply doing a search in the bug system would have revealed the current 
status of this:

   http://bugs.php.net/bug.php?id=49189&edit=1

The documentation team just hasn't got around changing the docs yet and 
adding a note about it there. Feel free to provide a patch or forever be 
silent.

--Jani

---

## #45561 — Lars Torben Wilson — 2009-09-11T06:49:02+00:00

URL: https://externals.io/message/45544#45561 · In reply to: #45556

Jani Taskinen wrote:
> 
> > […]
> 
> Simply doing a search in the bug system would have revealed the current 
> status of this:
> 
>   http://bugs.php.net/bug.php?id=49189&edit=1
> 
> The documentation team just hasn't got around changing the docs yet and 
> adding a note about it there. Feel free to provide a patch or forever be 
> silent.
> 
> --Jani

No need, fixed in the doc svn.


Torben
