r96405 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96404‎ | r96405 | r96406 >
Date:04:05, 7 September 2011
Author:robin
Status:ok
Tags:
Comment:
Per r90858 CR, throw MW exception on missing title context
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -690,14 +690,16 @@
691691 * @return Language
692692 */
693693 function getFunctionLang() {
694 - global $wgLang;
695 -
696694 $target = $this->mOptions->getTargetLanguage();
697695 if ( $target !== null ) {
698696 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' );
701702 }
 703+ return $this->mTitle->getPageLanguage();
702704 }
703705
704706 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r965121.18: MFT r95655, r96227, r96386, r96393, r96405, r96427, r96460, r96472. And...catrope22:18, 7 September 2011
r113001* Fix for r41340, r96405, r97849: introduce a function which gets the current...tstarling05:53, 5 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90858Make parser->getFunctionLang be dependent on title->getPageLanguage() instead...robin22:58, 26 June 2011

Status & tagging log