Last modified: 2011-03-13 18:05:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T13054, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 11054 - Patch to make mediawiki work in mbstring.func_overload environments
Patch to make mediawiki work in mbstring.func_overload environments
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
1.10.x
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review, utf8
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-24 15:33 UTC by Bernhard Weißhuhn
Modified: 2011-03-13 18:05 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Make UtfNormal.php use bytecount wrappers for strlen and substr in case of (mbstring.func_overload & 2) (6.41 KB, patch)
2007-08-24 15:33 UTC, Bernhard Weißhuhn
Details
Patch to UtfNormal.php against svn. (6.46 KB, patch)
2007-08-24 15:43 UTC, Bernhard Weißhuhn
Details

Description Bernhard Weißhuhn 2007-08-24 15:33:54 UTC
Created attachment 4036 [details]
Make UtfNormal.php use bytecount wrappers for strlen and substr in case of (mbstring.func_overload & 2)

Setting mbstring.func_overload in php.ini to override the string functions (strlen, substr, strpos...) breaks the functionality of UtfNormal.php, which relies on these functions to work with byte counts (as opposed to logical characters).

If you happen to be in an environment where this setting is active, mediawiki will garble request data, transcoding some of your non-Ascii characters and passing through others. Since the ini-settings cannot be disabled at runtime, I wrote wrappers for strlen and substr which always work on byte counts regardless of mbstring.func_overload.

btw: I tried setting mb_internal_encoding to '8bit' for mediawiki pages, but this did not affect the behaviour of the overloaded functions.

comments welcome,
  bkw
Comment 1 Bernhard Weißhuhn 2007-08-24 15:35:22 UTC
whoops, that patch is against my internal svk depot revision numbers, I'll supply one against mw svn. Sorry!
Comment 2 Bernhard Weißhuhn 2007-08-24 15:43:39 UTC
Created attachment 4037 [details]
Patch to UtfNormal.php against svn.

same same but different ;)
Comment 3 Niklas Laxström 2007-11-30 14:19:50 UTC
Do we really want this? I would assume other things in mediawiki would break too. Or is utfnormal the only thing? Could we just require overloading to be off?
Comment 4 Brion Vibber 2007-12-03 21:01:17 UTC
The function override mode will pretty much break things randomly, and should never be used by anybody.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links