From: Alexandre Emsenhuber Date: Wed, 26 Aug 2009 15:47:03 +0000 (+0000) Subject: * (bug 8143) Localised parser function names are now correctly case insensitive if... X-Git-Tag: 1.31.0-rc.0~40049 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=152638e907bc0ba13c155a095e8178b9e2590669;p=lhc%2Fweb%2Fwiklou.git * (bug 8143) Localised parser function names are now correctly case insensitive if they contain non-ASCII characters Patch by Matěj Grabovský - http://bug-attachment.wikimedia.org/attachment.cgi?id=6406 --- diff --git a/CREDITS b/CREDITS index fe776b6b28..714d6cdb87 100644 --- 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 diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 17e6fb0d20..3e205e4e17 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index ec9ff0d28a..78fd7a0b07 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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 ) ) {