Move Special:ChangeContentModel to the pagetools special page group
[lhc/web/wiklou.git] / includes / specials / SpecialUndelete.php
index b168b12..664205a 100644 (file)
@@ -587,7 +587,7 @@ class PageArchive {
                $restored = 0;
 
                foreach ( $result as $row ) {
-                       // Check for key dupes due to shitty archive integrity.
+                       // Check for key dupes due to needed archive integrity.
                        if ( $row->ar_rev_id ) {
                                $exists = $dbw->selectField( 'revision', '1',
                                        array( 'rev_id' => $row->ar_rev_id ), __METHOD__ );
@@ -636,8 +636,7 @@ class PageArchive {
                Hooks::run( 'ArticleUndelete', array( &$this->title, $created, $comment, $oldPageId ) );
 
                if ( $this->title->getNamespace() == NS_FILE ) {
-                       $update = new HTMLCacheUpdate( $this->title, 'imagelinks' );
-                       $update->doUpdate();
+                       DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this->title, 'imagelinks' ) );
                }
 
                return Status::newGood( $restored );
@@ -1210,6 +1209,8 @@ class SpecialUndelete extends SpecialPage {
        }
 
        protected function showHistory() {
+               $this->checkReadOnly();
+
                $out = $this->getOutput();
                if ( $this->mAllowed ) {
                        $out->addModules( 'mediawiki.special.undelete' );
@@ -1639,9 +1640,7 @@ class SpecialUndelete extends SpecialPage {
                        throw new ErrorPageError( 'undelete-error', 'filedelete-maintenance' );
                }
 
-               if ( wfReadOnly() ) {
-                       throw new ReadOnlyError;
-               }
+               $this->checkReadOnly();
 
                $out = $this->getOutput();
                $archive = new PageArchive( $this->mTargetObj, $this->getConfig() );