r49412 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49411‎ | r49412 | r49413 >
Date:18:23, 11 April 2009
Author:demon
Status:resolved (Comments)
Tags:
Comment:
No more $wgTitle in the diff engine.
Modified paths:
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -380,7 +380,7 @@
381381
382382
383383 function renderHtmlDiff() {
384 - global $wgOut, $wgTitle, $wgParser, $wgDebugComments;
 384+ global $wgOut, $wgParser, $wgDebugComments;
385385 wfProfileIn( __METHOD__ );
386386
387387 $this->showDiffStyle();
@@ -408,7 +408,7 @@
409409 $oldTidy = $popts->setTidy( true );
410410 $popts->setEditSection( false );
411411
412 - $parserOutput = $wgParser->parse( $this->mOldtext, $wgTitle, $popts, true, true, $wgOut->getRevisionId() );
 412+ $parserOutput = $wgParser->parse( $this->mOldtext, $this->getTitle(), $popts, true, true, $wgOut->getRevisionId() );
413413 $popts->setTidy( $oldTidy );
414414
415415 //only for new?
@@ -424,7 +424,7 @@
425425 $popts = $wgOut->parserOptions();
426426 $oldTidy = $popts->setTidy( true );
427427
428 - $parserOutput = $wgParser->parse( $this->mNewtext, $wgTitle, $popts, true, true, $wgOut->getRevisionId() );
 428+ $parserOutput = $wgParser->parse( $this->mNewtext, $this->getTitle(), $popts, true, true, $wgOut->getRevisionId() );
429429 $popts->setTidy( $oldTidy );
430430
431431 $wgOut->addParserOutputNoText( $parserOutput );

Follow-up revisions

RevisionCommit summaryAuthorDate
r51416Fix for r49412, possible fatal errors.tstarling16:33, 3 June 2009

Comments

#Comment by Tim Starling (talk | contribs)   12:36, 19 May 2009

I see that SpecialUndelete creates a DifferenceEngine object without initialising the title, as do several extensions. Could you fix the constructor to set $this->mTitle to $wgTitle if $titleObj is null, for backwards compatibility?

Status & tagging log