https://bugzilla.wikimedia.org/show_bug.cgi?id=16852
Summary: padleft and padright do not handle multibyte characters
properly
Product: MediaWiki
Version: 1.14-svn
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: Normal
Component: General/Unknown
AssignedTo: [email protected]
ReportedBy: [email protected]
Created an attachment (id=5635)
--> (https://bugzilla.wikimedia.org/attachment.cgi?id=5635)
Proposed patch v1
The built-in parser functions "padleft" and "padright" do not handle multibyte
characters properly. For example, including {{padright:Hello-|7|Æ}} anywhere
on a page blanks the entire page. Including multibyte characters in the first
parameter produces unexpected results, for example:
{{padleft:Æ|5}} = 000Æ when 0000Æ was expected
{{padleft:本|5}} = 00本 when 0000本 was expected
These problems severely reduce the usefulness of the padleft and padright
functions because there is no guarantee that the actual output will even
remotely resemble the expected output. The output could have the wrong amount
of padding, or blank the page entirely.
I'm including a patch I wrote that cleans up MediaWiki's pad function and gives
it proper support for multibyte characters. It also adds a couple test cases to
parserTests.txt.
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l