Page MenuHomePhabricator

Localized magic words don't ignore case if containing nonASCII characters
Closed, ResolvedPublic

Description

MessagesXx.php contains $magicWords array of synonyms.

The group of synonyms marked to ignore case ignores the case only if all the
synonyms are ASCII, otherwise not.

Test case:
MessagesCs.php
groups 'revisionday' and 'language' work properly
groups 'uc', 'fullurl' and many others don't - uppercase works properly,
lowercase appears as red link to non-existing template
Tested on cswikipedia 1.9alpha (r17974)


Version: unspecified
Severity: normal

Details

Reference
bz8143

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:30 PM
bzimport set Reference to bz8143.
bzimport added a subscriber: Unknown Object (MLST).
Danny_B created this task.Dec 4 2006, 1:09 AM

Just tested and case insensitive magic words do work correctly. Note that many magic words are marked as case sensitive.

They do not. Did you check localized magic words of those I mentioned above?

Excerpt from MessagesCs.php:

'lcfirst' => array( '0', 'PRVNÍMALÉ:', 'LCFIRST:' ), contains non-ASCII char(s)
'ucfirst' => array( '0', 'PRVNÍVELKÉ:', 'UCFIRST:' ),
'lc' => array( '0', 'MALÁ:', 'LC:' ),
'uc' => array( '0', 'VELKÁ:', 'UC:' ),
...
'padleft' => array( '0', 'ZAROVNATVLEVO', 'PADLEFT' ),
ASCII only
'padright'=> array( '0', 'ZAROVNATVPRAVO', 'PADRIGHT' ),

Tested on w:cs: sandbox:

{{PRVNÍVELKÉ:ěščř}} - OK
{{prvnívelké:ěščř}} - redlink to nonexisting template
{{PRVNÍMALÉ:ěščř}} - OK
{{prvnímalé:ěščř}} - redlink to nonexisting template
{{MALÁ:ěščř}} - OK
{{malá:ěščř}} - redlink to nonexisting template
{{VELKÁ:ěščř}} - OK
{{velká:ěščř}} - redlink to nonexisting template

etc., etc...

but:

{{zarovnatvlevo:12|5|x}} - OK
{{ZAROVNATVLEVO:12|5|x}} - OK
{{zarovnatvpravo:12|5|x}} - OK
{{ZAROVNATVPRAVO:12|5|x}} - OK

But {{názevserveru}} works, no idea why it is different.

Looks like only where additional params are, it won't work correctly. Magic words without params seem to work correctly though I didn't test all marked case-insensitive.

Created attachment 6406
Use $wgContLang->lc() instead of strtolower in some cases

Attached:

IAlex added a comment.Aug 26 2009, 3:48 PM

Fixed in r55601.