From: Tim Starling Date: Tue, 17 Feb 2009 14:02:12 +0000 (+0000) Subject: In Revision::newFromTitle(): don't do a query with WHERE rev_id='' when the page... X-Git-Tag: 1.31.0-rc.0~42855 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=fda50654b33218cb167e6cd5f732892d3540dfdc;p=lhc%2Fweb%2Fwiklou.git In Revision::newFromTitle(): don't do a query with WHERE rev_id='' when the page doesn't exist --- 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