From: Aaron Schulz Date: Fri, 1 Jul 2011 00:12:09 +0000 (+0000) Subject: Follow-up r91123: X-Git-Tag: 1.31.0-rc.0~29134 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=2c292086eb556b990ccd9993f03d7c8eed619270;p=lhc%2Fweb%2Fwiklou.git Follow-up r91123: * Tweaked getRevision() return type to NULL on failure * Changed "$revision === null" checks to just "!$revision" (this avoids the landmine of getting false or something) --- diff --git a/includes/Article.php b/includes/Article.php index 3c6e41c6f9..5340935a49 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -280,7 +280,7 @@ class Article extends Page { if ( $oldid ) { $revision = Revision::newFromId( $oldid ); - if ( $revision === null ) { + if ( !$revision ) { wfDebug( __METHOD__ . " failed to retrieve specified revision, id $oldid\n" ); return false; } @@ -300,7 +300,7 @@ class Article extends Page { } $revision = $this->mPage->getRevision(); - if ( $revision === null ) { + if ( !$revision ) { wfDebug( __METHOD__ . " failed to retrieve current page, rev_id " . $this->mPage->getLatest() . "\n" ); return false; } diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 20c7c6b2fd..eb99928c2b 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -471,14 +471,14 @@ class WikiPage extends Page { /** * Get the latest revision - * @return Revision|false + * @return Revision|null */ public function getRevision() { $this->loadLastEdit(); if ( $this->mLastRevision ) { return $this->mLastRevision; } - return false; + return null; } /**