From: Tim Starling Date: Sun, 7 Jan 2007 16:44:06 +0000 (+0000) Subject: Don't create a new parser on every call to wfMsgExt(), that's slow. X-Git-Tag: 1.31.0-rc.0~54599 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=49cda846a7f99b87b142c71d0b6d1e3566f7b30a;p=lhc%2Fweb%2Fwiklou.git Don't create a new parser on every call to wfMsgExt(), that's slow. --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 24e60cafa9..08094ca173 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -547,12 +547,10 @@ function wfMsgExt( $key, $options ) { $string = $m[1]; } } elseif ( in_array('parsemag', $options) ) { - global $wgTitle; - $parser = new Parser(); - $parserOptions = new ParserOptions(); - $parserOptions->setInterfaceMessage( true ); - $parser->startExternalParse( $wgTitle, $parserOptions, OT_MSG ); - $string = $parser->transformMsg( $string, $parserOptions ); + global $wgMessageCache; + if ( isset( $wgMessageCache ) ) { + $string = $wgMessageCache->transform( $string ); + } } if ( in_array('escape', $options) ) {