r110064 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110063‎ | r110064 | r110065 >
Date:16:44, 26 January 2012
Author:ialex
Status:ok
Tags:
Comment:
* Do the page existence check before calling ignore_user_abort() so that we don't return after having modified that value
* Change the check to use $oldid since we already have the result of getLatest()
Modified paths:
  • /trunk/phase3/includes/WikiPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/WikiPage.php
@@ -1275,6 +1275,15 @@
12761276 # Update article, but only if changed.
12771277 $status->value['new'] = false;
12781278
 1279+ if ( !$oldid ) {
 1280+ # Article gone missing
 1281+ wfDebug( __METHOD__ . ": EDIT_UPDATE specified but article doesn't exist\n" );
 1282+ $status->fatal( 'edit-gone-missing' );
 1283+
 1284+ wfProfileOut( __METHOD__ );
 1285+ return $status;
 1286+ }
 1287+
12791288 # Make sure the revision is either completely inserted or not inserted at all
12801289 if ( !$wgDBtransactions ) {
12811290 $userAbort = ignore_user_abort( true );
@@ -1294,15 +1303,6 @@
12951304 $changed = ( strcmp( $text, $oldtext ) != 0 );
12961305
12971306 if ( $changed ) {
1298 - if ( !$this->mLatest ) {
1299 - # Article gone missing
1300 - wfDebug( __METHOD__ . ": EDIT_UPDATE specified but article doesn't exist\n" );
1301 - $status->fatal( 'edit-gone-missing' );
1302 -
1303 - wfProfileOut( __METHOD__ );
1304 - return $status;
1305 - }
1306 -
13071307 $dbw->begin();
13081308 $revisionId = $revision->insertOn( $dbw );
13091309

Status & tagging log