r47359 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47358‎ | r47359 | r47360 >
Date:14:02, 17 February 2009
Author:tstarling
Status:ok
Tags:
Comment:
In Revision::newFromTitle(): don't do a query with WHERE rev_id='' when the page doesn't exist
Modified paths:
  • /trunk/phase3/includes/Revision.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Revision.php
@@ -53,6 +53,10 @@
5454 // Get the latest revision ID from the master
5555 $dbw = wfGetDB( DB_MASTER );
5656 $latest = $dbw->selectField( 'page', 'page_latest', $conds, __METHOD__ );
 57+ if ( $latest === false ) {
 58+ // Page does not exist
 59+ return null;
 60+ }
5761 $conds['rev_id'] = $latest;
5862 } else {
5963 // Use a join to get the latest revision

Status & tagging log