From: Alexandre Emsenhuber Date: Tue, 25 Oct 2011 18:14:30 +0000 (+0000) Subject: Unstub $wgLang if still stubbed before storing it; avoid storing a StubUserLang insta... X-Git-Tag: 1.31.0-rc.0~26918 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=f05d7ee8eee24a03366cccbf1188c194bb94e4d9;p=lhc%2Fweb%2Fwiklou.git Unstub $wgLang if still stubbed before storing it; avoid storing a StubUserLang instance in ParserOptions and errors when getting the object (per report of Lockal on IRC) --- diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index b4660a4650..7cf3f741b7 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -195,6 +195,9 @@ class ParserOptions { } if ( $lang === null ) { global $wgLang; + if ( !StubObject::isRealObject( $wgLang ) ) { + $wgLang->_unstub(); + } $lang = $wgLang; } $this->initialiseFromUser( $user, $lang );