From 82a74a2e32d4500f8f20db8533a546c52f5f9678 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 2 Aug 2006 03:19:55 +0000 Subject: [PATCH] Fixed {{grammar:}} tags in namespace names --- languages/Language.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/languages/Language.php b/languages/Language.php index b4de4a1e0b..fd135397b3 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1466,11 +1466,9 @@ class Language { # Allowing full message-style parsing would make simple requests # such as action=raw much more expensive than they need to be. # This will hopefully cover most cases. - if ( preg_match( '/{{grammar:(.*?)\|(.*?)}}/i', $talk, $m ) ) { - $talk = str_replace( ' ', '_', - $this->convertGrammar( trim( $m[2] ), trim( $m[1] ) ) - ); - } + $talk = preg_replace_callback( '/{{grammar:(.*?)\|(.*?)}}/', + array( &$this, 'replaceGrammarInNamespace' ), $talk ); + $talk = str_replace( ' ', '_', $talk ); $this->namespaceNames[NS_PROJECT_TALK] = $talk; } @@ -1503,6 +1501,10 @@ class Language { wfProfileOut( __METHOD__ ); } + function replaceGrammarInNamespace( $m ) { + return $this->convertGrammar( trim( $m[2] ), trim( $m[1] ) ); + } + static function getCaseMaps() { static $wikiUpperChars, $wikiLowerChars; global $IP; -- 2.20.1