Index: trunk/phase3/includes/Parser.php |
— | — | @@ -2758,8 +2758,9 @@ |
2759 | 2759 | * @private |
2760 | 2760 | */ |
2761 | 2761 | function variableSubstitution( $matches ) { |
| 2762 | + global $wgContLang; |
2762 | 2763 | $fname = 'Parser::variableSubstitution'; |
2763 | | - $varname = $matches[1]; |
| 2764 | + $varname = $wgContLang->lc($matches[1]); |
2764 | 2765 | wfProfileIn( $fname ); |
2765 | 2766 | $skip = false; |
2766 | 2767 | if ( $this->mOutputType == OT_WIKI ) { |
— | — | @@ -2773,8 +2774,14 @@ |
2774 | 2775 | } |
2775 | 2776 | if ( !$skip && array_key_exists( $varname, $this->mVariables ) ) { |
2776 | 2777 | $id = $this->mVariables[$varname]; |
2777 | | - $text = $this->getVariableValue( $id ); |
2778 | | - $this->mOutput->mContainsOldMagic = true; |
| 2778 | + # Now check if we did really match, case sensitive or not |
| 2779 | + $mw =& MagicWord::get( $id ); |
| 2780 | + if ($mw->match($matches[1])) { |
| 2781 | + $text = $this->getVariableValue( $id ); |
| 2782 | + $this->mOutput->mContainsOldMagic = true; |
| 2783 | + } else { |
| 2784 | + $text = $matches[0]; |
| 2785 | + } |
2779 | 2786 | } else { |
2780 | 2787 | $text = $matches[0]; |
2781 | 2788 | } |
Index: trunk/phase3/includes/MagicWord.php |
— | — | @@ -178,7 +178,7 @@ |
179 | 179 | $escSyn[] = preg_quote( $synonym, '/' ); |
180 | 180 | $this->mBaseRegex = implode( '|', $escSyn ); |
181 | 181 | |
182 | | - $case = $this->mCaseSensitive ? '' : 'i'; |
| 182 | + $case = $this->mCaseSensitive ? '' : 'iu'; |
183 | 183 | $this->mRegex = "/{$this->mBaseRegex}/{$case}"; |
184 | 184 | $this->mRegexStart = "/^(?:{$this->mBaseRegex})/{$case}"; |
185 | 185 | $this->mVariableRegex = str_replace( "\\$1", "(.*?)", $this->mRegex ); |
— | — | @@ -205,7 +205,7 @@ |
206 | 206 | if ( $this->mRegex === '' ) |
207 | 207 | $this->initRegex(); |
208 | 208 | |
209 | | - return $this->mCaseSensitive ? '' : 'i'; |
| 209 | + return $this->mCaseSensitive ? '' : 'iu'; |
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
— | — | @@ -378,8 +378,9 @@ |
379 | 379 | * lookup in a list of magic words |
380 | 380 | */ |
381 | 381 | function addToArray( &$array, $value ) { |
| 382 | + global $wgContLang; |
382 | 383 | foreach ( $this->mSynonyms as $syn ) { |
383 | | - $array[$syn] = $value; |
| 384 | + $array[$wgContLang->lc($syn)] = $value; |
384 | 385 | } |
385 | 386 | } |
386 | 387 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -271,6 +271,7 @@ |
272 | 272 | * (bug 7499) Corrections to Swedish talk namespace names |
273 | 273 | * (bug 7508) Added option to compress HTML pages by dumpHTML.php |
274 | 274 | * (bug 7519) Add plural in SpecialWatchlist |
| 275 | +* (bug 7459) Magic word variables are always case sensitive |
275 | 276 | |
276 | 277 | == Languages updated == |
277 | 278 | |