Unstub $wgLang if still stubbed before storing it; avoid storing a StubUserLang insta...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 25 Oct 2011 18:14:30 +0000 (18:14 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 25 Oct 2011 18:14:30 +0000 (18:14 +0000)
includes/parser/ParserOptions.php

index b4660a4..7cf3f74 100644 (file)
@@ -195,6 +195,9 @@ class ParserOptions {
                }
                if ( $lang === null ) {
                        global $wgLang;
+                       if ( !StubObject::isRealObject( $wgLang ) ) {
+                               $wgLang->_unstub();
+                       }
                        $lang = $wgLang;
                }
                $this->initialiseFromUser( $user, $lang );