From 4630a0774105b23d023f01e8c6b517f39646d3ba Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 14 Mar 2012 17:55:59 +0000 Subject: [PATCH] Reverted r113803: makes already messy class messier (a bit to much) --- includes/diff/DifferenceEngine.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index f1bee3c5b7..e8f35f0d0a 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -1003,23 +1003,17 @@ class DifferenceEngine extends ContextSource { $this->loadRevisionIds(); // Load the new revision object - if ( $this->mNewid && ( !$this->canUseWikiPage() - || $this->mNewid !== $this->getWikiPage()->getLatest() ) ) - { - $this->mNewRev = Revision::newFromId( $this->mNewid ); - } else { - $this->mNewRev = $this->getWikiPage()->getRevision(); - $this->mNewPage = $this->getTitle(); - } + $this->mNewRev = $this->mNewid + ? Revision::newFromId( $this->mNewid ) + : Revision::newFromTitle( $this->getTitle() ); if ( !$this->mNewRev instanceof Revision ) { return false; } - if ( !$this->mNewPage instanceof Title ) { - $this->mNewPage = $this->mNewRev->getTitle(); - } + // Update the new revision ID in case it was 0 (makes life easier doing UI stuff) $this->mNewid = $this->mNewRev->getId(); + $this->mNewPage = $this->mNewRev->getTitle(); // Load the old revision object $this->mOldRev = false; -- 2.20.1