From 49cda846a7f99b87b142c71d0b6d1e3566f7b30a Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 7 Jan 2007 16:44:06 +0000 Subject: [PATCH] Don't create a new parser on every call to wfMsgExt(), that's slow. --- includes/GlobalFunctions.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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) ) { -- 2.20.1