From: Niklas Laxström Date: Tue, 13 Nov 2007 09:55:45 +0000 (+0000) Subject: * Fetch linkprefix only when needed X-Git-Tag: 1.31.0-rc.0~50889 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=07fd6c1224995772d293f79d8d494c673a758e82;p=lhc%2Fweb%2Fwiklou.git * Fetch linkprefix only when needed --- diff --git a/includes/Parser.php b/includes/Parser.php index 3815dcb4f2..7754fa3334 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -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" ); }