Clean up Special:Undelete read-only checks
[lhc/web/wiklou.git] / includes / specials / SpecialUndelete.php
index a66a3d1..00ee327 100644 (file)
@@ -555,7 +555,7 @@ class PageArchive {
                $user = User::newFromName( $revision->getUserText( Revision::RAW ), false );
                $content = $revision->getContent( Revision::RAW );
 
-               //NOTE: article ID may not be known yet. prepareSave() should not modify the database.
+               // NOTE: article ID may not be known yet. prepareSave() should not modify the database.
                $status = $content->prepareSave( $article, 0, -1, $user );
 
                if ( !$status->isOK() ) {
@@ -1210,6 +1210,8 @@ class SpecialUndelete extends SpecialPage {
        }
 
        protected function showHistory() {
+               $this->checkReadOnly();
+
                $out = $this->getOutput();
                if ( $this->mAllowed ) {
                        $out->addModules( 'mediawiki.special.undelete' );
@@ -1639,9 +1641,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() );