In Revision::newFromTitle(): don't do a query with WHERE rev_id='' when the page...
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 17 Feb 2009 14:02:12 +0000 (14:02 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 17 Feb 2009 14:02:12 +0000 (14:02 +0000)
includes/Revision.php

index 458b312..8a2149c 100644 (file)
@@ -53,6 +53,10 @@ class Revision {
                        // Get the latest revision ID from the master
                        $dbw = wfGetDB( DB_MASTER );
                        $latest = $dbw->selectField( 'page', 'page_latest', $conds, __METHOD__ );
+                       if ( $latest === false ) {
+                               // Page does not exist
+                               return null;
+                       }
                        $conds['rev_id'] = $latest;
                } else {
                        // Use a join to get the latest revision