From: Tim Starling Date: Mon, 3 Jul 2006 11:17:27 +0000 (+0000) Subject: Better to clone $wgParser rather than use it, otherwise things like {{int:}} would... X-Git-Tag: 1.31.0-rc.0~56441 X-Git-Url: http://git.cyclocoop.org//%22%22.str_replace%28%27%22%27%2C?a=commitdiff_plain;h=124cec89460a96e34b85ff31396db65703cfafe2;p=lhc%2Fweb%2Fwiklou.git Better to clone $wgParser rather than use it, otherwise things like {{int:}} would be broken. --- diff --git a/includes/MessageCache.php b/includes/MessageCache.php index 666673423e..cebb86fb28 100644 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -40,6 +40,7 @@ class MessageCache { wfProfileIn( __METHOD__.'-parseropt' ); $this->mParserOptions = new ParserOptions( $u=NULL ); wfProfileOut( __METHOD__.'-parseropt' ); + $this->mParser = null; # When we first get asked for a message, # then we'll fill up the cache. If we @@ -522,9 +523,12 @@ class MessageCache { function transform( $message ) { global $wgParser; - if( !$this->mDisableTransform && isset( $wgParser ) ) { + if ( !$this->mParser && isset( $wgParser ) ) { + $this->mParser = clone $wgParser; + } + if ( !$this->mDisableTransform && $this->mParser ) { if( strpos( $message, '{{' ) !== false ) { - $message = $wgParser->transformMsg( $message, $this->mParserOptions ); + $message = $this->mParser->transformMsg( $message, $this->mParserOptions ); } } return $message;