Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -690,14 +690,16 @@ |
691 | 691 | * @return Language |
692 | 692 | */ |
693 | 693 | function getFunctionLang() { |
694 | | - global $wgLang; |
695 | | - |
696 | 694 | $target = $this->mOptions->getTargetLanguage(); |
697 | 695 | if ( $target !== null ) { |
698 | 696 | return $target; |
699 | | - } else { |
700 | | - return $this->mOptions->getInterfaceMessage() ? $wgLang : $this->mTitle->getPageLanguage(); |
| 697 | + } elseif( $this->mOptions->getInterfaceMessage() ) { |
| 698 | + global $wgLang; |
| 699 | + return $wgLang; |
| 700 | + } elseif( is_null( $this->mTitle ) ) { |
| 701 | + throw new MWException( __METHOD__.': $this->mTitle is null' ); |
701 | 702 | } |
| 703 | + return $this->mTitle->getPageLanguage(); |
702 | 704 | } |
703 | 705 | |
704 | 706 | /** |