Follow-up r91123:
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 1 Jul 2011 00:12:09 +0000 (00:12 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 1 Jul 2011 00:12:09 +0000 (00:12 +0000)
* 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
includes/WikiPage.php

index 3c6e41c..5340935 100644 (file)
@@ -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;
                        }
index 20c7c6b..eb99928 100644 (file)
@@ -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;
        }
 
        /**