* Fetch linkprefix only when needed
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 13 Nov 2007 09:55:45 +0000 (09:55 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 13 Nov 2007 09:55:45 +0000 (09:55 +0000)
includes/Parser.php

index 3815dcb..7754fa3 100644 (file)
@@ -1578,11 +1578,15 @@ class Parser
                # Match cases where there is no "]]", which might still be images
                static $e1_img = FALSE;
                if ( !$e1_img ) { $e1_img = "/^([{$tc}]+)\\|(.*)\$/sD"; }
-               # Match the end of a line for a word that's not followed by whitespace,
-               # e.g. in the case of 'The Arab al[[Razi]]', 'al' will be matched
-               $e2 = wfMsgForContent( 'linkprefix' );
 
                $useLinkPrefixExtension = $wgContLang->linkPrefixExtension();
+               $e2 = null;
+               if ( $useLinkPrefixExtension ) {
+                       # Match the end of a line for a word that's not followed by whitespace,
+                       # e.g. in the case of 'The Arab al[[Razi]]', 'al' will be matched
+                       $e2 = wfMsgForContent( 'linkprefix' );
+               }
+
                if( is_null( $this->mTitle ) ) {
                        throw new MWException( __METHOD__.": \$this->mTitle is null\n" );
                }