From: Robin Pepermans Date: Wed, 7 Sep 2011 04:05:37 +0000 (+0000) Subject: Per r90858 CR, throw MW exception on missing title context X-Git-Tag: 1.31.0-rc.0~27849 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=4ae1ef34c199b269db9aec94a569df0ffb111d42;p=lhc%2Fweb%2Fwiklou.git Per r90858 CR, throw MW exception on missing title context --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 2e8a07dc73..02cef7d026 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -690,14 +690,16 @@ class Parser { * @return Language */ function getFunctionLang() { - global $wgLang; - $target = $this->mOptions->getTargetLanguage(); if ( $target !== null ) { return $target; - } else { - return $this->mOptions->getInterfaceMessage() ? $wgLang : $this->mTitle->getPageLanguage(); + } elseif( $this->mOptions->getInterfaceMessage() ) { + global $wgLang; + return $wgLang; + } elseif( is_null( $this->mTitle ) ) { + throw new MWException( __METHOD__.': $this->mTitle is null' ); } + return $this->mTitle->getPageLanguage(); } /**