From c3193cbcd00e6d817045d7d8d19b67dae0620b08 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 8 May 2008 19:26:41 +0000 Subject: [PATCH] Partial correctness fix; use lazy-loading $this->getTitle() instead of $this->mTitle in Revision::getPrevious() and Revision::getNext(). This will ensure they work even if the objects were fetched in a way that didn't initialize $this->mTitle... unless they aren't fully saved in the DB, in which case they'll still fail with a fatal error. --- includes/Revision.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Revision.php b/includes/Revision.php index 9e473c2c87..f704846597 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -536,7 +536,7 @@ class Revision { * @return Revision */ public function getPrevious() { - $prev = $this->mTitle->getPreviousRevisionID( $this->mId ); + $prev = $this->getTitle()->getPreviousRevisionID( $this->mId ); if( $prev ) { return Revision::newFromTitle( $this->mTitle, $prev ); } else { @@ -548,7 +548,7 @@ class Revision { * @return Revision */ public function getNext() { - $next = $this->mTitle->getNextRevisionID( $this->mId ); + $next = $this->getTitle()->getNextRevisionID( $this->mId ); if ( $next ) { return Revision::newFromTitle( $this->mTitle, $next ); } else { -- 2.20.1