From: Brion Vibber Date: Thu, 8 May 2008 19:26:41 +0000 (+0000) Subject: Partial correctness fix; use lazy-loading $this->getTitle() instead of $this->mTitle... X-Git-Tag: 1.31.0-rc.0~47808 X-Git-Url: https://git.cyclocoop.org/?a=commitdiff_plain;h=c3193cbcd00e6d817045d7d8d19b67dae0620b08;p=lhc%2Fweb%2Fwiklou.git 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. --- 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 {