* (bug 8143) Localised parser function names are now correctly case insensitive if...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 26 Aug 2009 15:47:03 +0000 (15:47 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 26 Aug 2009 15:47:03 +0000 (15:47 +0000)
Patch by Matěj Grabovský - http://bug-attachment.wikimedia.org/attachment.cgi?id=6406

CREDITS
RELEASE-NOTES
includes/parser/Parser.php

diff --git a/CREDITS b/CREDITS
index fe776b6..714d6cd 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -82,6 +82,7 @@ following names for their contribution to the product.
 * Marcin Cieślak
 * Marcus Buck
 * Marooned
+* Matěj Grabovský
 * mati
 * Max Semenik
 * Michael De La Rue
index 17e6fb0..3e205e4 100644 (file)
@@ -434,6 +434,8 @@ this. Was used when mwEmbed was going to be an extension.
   the file description page instead of MediaWiki:License
 * (bug 20380) Link to history/log action at the top of Special:RevisionDelete
   are new more displayed when when doing log suppression
+* (bug 8143) Localised parser function names are now correctly case insensitive
+  if they contain non-ASCII characters
 
 == API changes in 1.16 ==
 
index ec9ff0d..78fd7a0 100644 (file)
@@ -2760,7 +2760,7 @@ class Parser
                                        $function = $this->mFunctionSynonyms[1][$function];
                                } else {
                                        # Case insensitive functions
-                                       $function = strtolower( $function );
+                                       $function = $wgContLang->lc( $function );
                                        if ( isset( $this->mFunctionSynonyms[0][$function] ) ) {
                                                $function = $this->mFunctionSynonyms[0][$function];
                                        } else {
@@ -4140,6 +4140,8 @@ class Parser
         * @return The old callback function for this name, if any
         */
        function setFunctionHook( $id, $callback, $flags = 0 ) {
+               global $wgContLang;
+
                $oldVal = isset( $this->mFunctionHooks[$id] ) ? $this->mFunctionHooks[$id][0] : null;
                $this->mFunctionHooks[$id] = array( $callback, $flags );
 
@@ -4154,7 +4156,7 @@ class Parser
                foreach ( $synonyms as $syn ) {
                        # Case
                        if ( !$sensitive ) {
-                               $syn = strtolower( $syn );
+                               $syn = $wgContLang->lc( $syn );
                        }
                        # Add leading hash
                        if ( !( $flags & SFH_NO_HASH ) ) {