r97050 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97049‎ | r97050 | r97051 >
Date:12:32, 14 September 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Followup r86304, guard against $title AND $wgTitle being null


Add profiling too
Modified paths:
  • /trunk/phase3/includes/cache/MessageCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/cache/MessageCache.php
@@ -817,15 +817,23 @@
818818 $popts->setTargetLanguage( $language );
819819 }
820820
 821+ wfProfileIn( __METHOD__ );
821822 if ( !$title || !$title instanceof Title ) {
822823 global $wgTitle;
823824 $title = $wgTitle;
824825 }
 826+ // Sometimes $wgTitle isn't set either...
 827+ if ( !$title ) {
 828+ # It's not uncommon having a null $wgTitle in scripts. See r80898
 829+ # Create a ghost title in such case
 830+ $title = Title::newFromText( 'Dwimmerlaik' );
 831+ }
825832
826833 $this->mInParser = true;
827834 $res = $parser->parse( $text, $title, $popts, $linestart );
828835 $this->mInParser = false;
829836
 837+ wfProfileOut( __METHOD__ );
830838 return $res;
831839 }
832840

Follow-up revisions

RevisionCommit summaryAuthorDate
r97263REL1_18 MFT r93626, r96562, r96640, r96978, r97050reedy13:19, 16 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86304* (bug 28532) wfMsgExt() and wfMsgWikiHtml() use $wgOut->parse()...reedy12:43, 18 April 2011
r86735Followup to r86312...reedy20:17, 22 April 2011

Comments

#Comment by Nikerabbit (talk | contribs)   13:34, 14 September 2011

/me approves.

Status & tagging log