From 92bb6aff58f5a4ac66d3023dc6ab8b9e777a2432 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 20 Mar 2005 10:31:55 +0000 Subject: [PATCH] Fail gracefully when given bogus revisions --- includes/DifferenceEngine.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/DifferenceEngine.php b/includes/DifferenceEngine.php index 767c736d5e..93cec347d8 100644 --- a/includes/DifferenceEngine.php +++ b/includes/DifferenceEngine.php @@ -270,6 +270,9 @@ class DifferenceEngine { } else { $this->newRev =& Revision::newFromTitle( $wgTitle ); } + if( is_null( $this->newRev ) ) { + return false; + } if( $this->newRev->isCurrent() ) { $this->mPagetitle = htmlspecialchars( wfMsg( 'currentrev' ) ); @@ -290,6 +293,9 @@ class DifferenceEngine { $this->oldRev =& $this->newRev->getPrevious(); $this->mOldid = $this->oldRev->getId(); } + if( is_null( $this->oldRev ) ) { + return false; + } $this->mOldPage = $this->oldRev->getTitle(); -- 2.20.1