From f05d7ee8eee24a03366cccbf1188c194bb94e4d9 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 25 Oct 2011 18:14:30 +0000 Subject: [PATCH] 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) --- includes/parser/ParserOptions.php | 3 +++ 1 file changed, 3 insertions(+) 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 ); -- 2.20.1