https://www.mediawiki.org/wiki/Special:Code/MediaWiki/110064

Revision: 110064
Author:   ialex
Date:     2012-01-26 16:44:29 +0000 (Thu, 26 Jan 2012)
Log Message:
-----------
* 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: trunk/phase3/includes/WikiPage.php
===================================================================
--- trunk/phase3/includes/WikiPage.php  2012-01-26 16:17:00 UTC (rev 110063)
+++ trunk/phase3/includes/WikiPage.php  2012-01-26 16:44:29 UTC (rev 110064)
@@ -1275,6 +1275,15 @@
                        # Update article, but only if changed.
                        $status->value['new'] = false;
 
+                       if ( !$oldid ) {
+                               # Article gone missing
+                               wfDebug( __METHOD__ . ": EDIT_UPDATE specified 
but article doesn't exist\n" );
+                               $status->fatal( 'edit-gone-missing' );
+
+                               wfProfileOut( __METHOD__ );
+                               return $status;
+                       }
+
                        # Make sure the revision is either completely inserted 
or not inserted at all
                        if ( !$wgDBtransactions ) {
                                $userAbort = ignore_user_abort( true );
@@ -1294,15 +1303,6 @@
                        $changed = ( strcmp( $text, $oldtext ) != 0 );
 
                        if ( $changed ) {
-                               if ( !$this->mLatest ) {
-                                       # Article gone missing
-                                       wfDebug( __METHOD__ . ": EDIT_UPDATE 
specified but article doesn't exist\n" );
-                                       $status->fatal( 'edit-gone-missing' );
-
-                                       wfProfileOut( __METHOD__ );
-                                       return $status;
-                               }
-
                                $dbw->begin();
                                $revisionId = $revision->insertOn( $dbw );
 


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to