Merge "Fix indenting and newlines"
[lhc/web/wiklou.git] / includes / specials / SpecialMovepage.php
index 464be4f..5cbad8a 100644 (file)
@@ -547,6 +547,15 @@ class MovePageForm extends UnlistedSpecialPage {
                                return;
                        }
 
+                       $page = WikiPage::factory( $nt );
+
+                       // Small safety margin to guard against concurrent edits
+                       if ( $page->isBatchedDelete( 5 ) ) {
+                               $this->showForm( [ [ 'movepage-delete-first' ] ] );
+
+                               return;
+                       }
+
                        $reason = $this->msg( 'delete_and_move_reason', $ot )->inContentLanguage()->text();
 
                        // Delete an associated image if there is
@@ -559,7 +568,6 @@ class MovePageForm extends UnlistedSpecialPage {
                        }
 
                        $error = ''; // passed by ref
-                       $page = WikiPage::factory( $nt );
                        $deleteStatus = $page->doDeleteArticleReal( $reason, false, 0, true, $error, $user );
                        if ( !$deleteStatus->isGood() ) {
                                $this->showForm( $deleteStatus->getErrorsArray() );
@@ -781,12 +789,6 @@ class MovePageForm extends UnlistedSpecialPage {
                # Deal with watches (we don't watch subpages)
                WatchAction::doWatchOrUnwatch( $this->watch, $ot, $user );
                WatchAction::doWatchOrUnwatch( $this->watch, $nt, $user );
-
-               /**
-                * T163966
-                * Increment user_editcount during page moves
-                */
-               $user->incEditCount();
        }
 
        function showLogFragment( $title ) {