From: Niklas Laxström Date: Sun, 15 May 2011 07:16:25 +0000 (+0000) Subject: Fixed a bug in transformation where previous language could leak into later transform... X-Git-Tag: 1.31.0-rc.0~30174 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%7B%7B%20url_for%28%27vote%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=7fe4a8e1bb216d04f4fb1b2d14e122abd51cb5ac;p=lhc%2Fweb%2Fwiklou.git Fixed a bug in transformation where previous language could leak into later transformations in UI language. Not sure what do with userlang. --- diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 3e0668c807..28add721ca 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -761,11 +761,12 @@ class MessageCache { $popts = $this->getParserOptions(); $popts->setInterfaceMessage( $interface ); $popts->setTargetLanguage( $language ); - $popts->setUserLang( $language ); + $userlang = $popts->setUserLang( $language ); $this->mInParser = true; $message = $parser->transformMsg( $message, $popts, $title ); $this->mInParser = false; + $popts->setUserLang( $userlang ); } return $message; } diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index a310617ccb..88e25844a3 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -137,7 +137,7 @@ class ParserOptions { function setTidy( $x ) { return wfSetVar( $this->mTidy, $x); } function setSkin( $x ) { $this->mSkin = $x; } function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x); } - function setTargetLanguage( $x ) { return wfSetVar( $this->mTargetLanguage, $x); } + function setTargetLanguage( $x ) { return wfSetVar( $this->mTargetLanguage, $x, true ); } function setMaxIncludeSize( $x ) { return wfSetVar( $this->mMaxIncludeSize, $x ); } function setMaxPPNodeCount( $x ) { return wfSetVar( $this->mMaxPPNodeCount, $x ); } function setMaxTemplateDepth( $x ) { return wfSetVar( $this->mMaxTemplateDepth, $x ); }