From fda50654b33218cb167e6cd5f732892d3540dfdc Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 17 Feb 2009 14:02:12 +0000 Subject: [PATCH] In Revision::newFromTitle(): don't do a query with WHERE rev_id='' when the page doesn't exist --- includes/Revision.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/Revision.php b/includes/Revision.php index 458b312daa..8a2149c0de 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -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 -- 2.20.1