Merge "Fix HeaderCallback failing on headers without a colon"
[lhc/web/wiklou.git] / includes / MovePage.php
index ffe4fab..bcec0a1 100644 (file)
@@ -21,6 +21,7 @@
 
 use MediaWiki\MediaWikiServices;
 use MediaWiki\Revision\SlotRecord;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Handles the backend logic of moving a page from one title
@@ -250,7 +251,7 @@ class MovePage {
                }
 
                $dbw = wfGetDB( DB_MASTER );
-               $dbw->startAtomic( __METHOD__ );
+               $dbw->startAtomic( __METHOD__, IDatabase::ATOMIC_CANCELABLE );
 
                Hooks::run( 'TitleMoveStarting', [ $this->oldTitle, $this->newTitle, $user ] );
 
@@ -425,7 +426,7 @@ class MovePage {
         * Move a file associated with a page to a new location.
         * Can also be used to revert after a DB failure.
         *
-        * @access private
+        * @private
         * @param Title Old location to move the file from.
         * @param Title New location to move the file to.
         * @return Status
@@ -433,7 +434,7 @@ class MovePage {
        private function moveFile( $oldTitle, $newTitle ) {
                $status = Status::newFatal(
                        'cannotdelete',
-                       $oldTitle->getPrefixedText()->escaped()
+                       $oldTitle->getPrefixedText()
                );
 
                $file = wfLocalFile( $oldTitle );
@@ -493,7 +494,8 @@ class MovePage {
                        );
 
                        if ( !$status->isGood() ) {
-                               throw new MWException( 'Failed to delete page-move revision: ' . $status );
+                               throw new MWException( 'Failed to delete page-move revision: '
+                                       . $status->getWikiText( false, false, 'en' ) );
                        }
 
                        $nt->resetArticleID( false );