From 2c292086eb556b990ccd9993f03d7c8eed619270 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 1 Jul 2011 00:12:09 +0000 Subject: [PATCH] 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) --- includes/Article.php | 4 ++-- includes/WikiPage.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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; } /** -- 2.20.1