Clean up Special:Undelete read-only checks
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 4 Oct 2015 20:35:16 +0000 (13:35 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 4 Oct 2015 20:35:16 +0000 (13:35 -0700)
* Use the standard SpecialPage method
* Show the error when trying to view the form for a page

Change-Id: I60a939e7d1a1164db2dc90525a750573be75fbcc

includes/specials/SpecialUndelete.php

index b168b12..00ee327 100644 (file)
@@ -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() );