From 07fd6c1224995772d293f79d8d494c673a758e82 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 13 Nov 2007 09:55:45 +0000 Subject: [PATCH] * Fetch linkprefix only when needed --- includes/Parser.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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" ); } -- 2.20.1