Merge "Hard deprecate codepaths where tidy is disabled"
[lhc/web/wiklou.git] / includes / MovePage.php
index ecd12c6..0fd697b 100644 (file)
@@ -240,7 +240,12 @@ class MovePage {
        public function move( User $user, $reason, $createRedirect, array $changeTags = [] ) {
                global $wgCategoryCollation;
 
-               Hooks::run( 'TitleMove', [ $this->oldTitle, $this->newTitle, $user ] );
+               $status = Status::newGood();
+               Hooks::run( 'TitleMove', [ $this->oldTitle, $this->newTitle, $user, $reason, &$status ] );
+               if ( !$status->isOK() ) {
+                       // Move was aborted by the hook
+                       return $status;
+               }
 
                // If it is a file, move it first.
                // It is done before all other moving stuff is done because it's hard to revert.
@@ -543,6 +548,13 @@ class MovePage {
                $nullRevId = $nullRevision->insertOn( $dbw );
                $logEntry->setAssociatedRevId( $nullRevId );
 
+               /**
+                * T163966
+                * Increment user_editcount during page moves
+                * Moved from SpecialMovepage.php per T195550
+                */
+               $user->incEditCount();
+
                if ( !$redirectContent ) {
                        // Clean up the old title *before* reset article id - T47348
                        WikiPage::onArticleDelete( $this->oldTitle );