Quick hack to fix the broken hack noted in bug 15301
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 26 Aug 2008 18:51:27 +0000 (18:51 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 26 Aug 2008 18:51:27 +0000 (18:51 +0000)
Use of:
$action_desc[0] = strtolower($action_desc[0]);
is horrible wrong for a few reasons:

1) The first-byte match fails for all non-ASCII characters -- use lcfirst()!
2) System strtolower() or lcfirst() may not work for UTF-8 or lang-specific issues properly; use $wgLang->lcfirst()
3) You shouldn't be forcing things to lowercase here anyway, you can't know it's correct gramattically.

This whole message output should be redone cleanly; either all the rights info messages should be designed to work in an inline list sentence, or they should be formatted as stand-alone text strings using a <ul> or something.

includes/OutputPage.php

index 27f3698..1da96b6 100644 (file)
@@ -1157,8 +1157,9 @@ class OutputPage {
                if ($action == null) {
                        $text = wfMsgNoTrans( 'permissionserrorstext', count($errors)). "\n\n";
                } else {
+                       global $wgLang;
                        $action_desc = wfMsg( "right-$action" );
-                       $action_desc[0] = strtolower($action_desc[0]);
+                       $action_desc = $wgLang->lcfirst( $action_desc ); // FIXME: TERRIBLE HACK
                        $text = wfMsgNoTrans( 'permissionserrorstext-withaction', count($errors), $action_desc ) . "\n\n";
                }