jenkins-bot has submitted this change and it was merged.

Change subject: Cleanup SpecialNuke::execute()
......................................................................


Cleanup SpecialNuke::execute()

Change-Id: I4427b1becedd29a41ed03b76dde66d13f5098941
---
M Nuke_body.php
1 file changed, 6 insertions(+), 12 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Nuke_body.php b/Nuke_body.php
index 4ddc1d8..a88ca14 100644
--- a/Nuke_body.php
+++ b/Nuke_body.php
@@ -11,24 +11,18 @@
        }
 
        public function execute( $par ) {
-               if ( !$this->userCanExecute( $this->getUser() ) ) {
-                       $this->displayRestrictionError();
-               }
                $this->setHeaders();
+               $this->checkPermissions();
+               $this->checkReadOnly();
                $this->outputHeader();
 
-               if ( $this->getUser()->isBlocked() ) {
-                       $block = $this->getUser()->getBlock();
+               $currentUser = $this->getUser();
+               if ( $currentUser->isBlocked() ) {
+                       $block = $currentUser->getBlock();
                        throw new UserBlockedError( $block );
                }
 
-               if ( method_exists( $this, 'checkReadOnly' ) ) {
-                       // checkReadOnly was introduced only in 1.19
-                       $this->checkReadOnly();
-               }
-
                $req = $this->getRequest();
-
                $target = trim( $req->getText( 'target', $par ) );
 
                // Normalise name
@@ -50,7 +44,7 @@
                $namespace = ctype_digit( $namespace ) ? (int)$namespace : null;
 
                if ( $req->wasPosted()
-                       && $this->getUser()->matchEditToken( $req->getVal( 
'wpEditToken' ) )
+                       && $currentUser->matchEditToken( $req->getVal( 
'wpEditToken' ) )
                ) {
 
                        if ( $req->getVal( 'action' ) === 'delete' ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/290637
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4427b1becedd29a41ed03b76dde66d13f5098941
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Nuke
Gerrit-Branch: master
Gerrit-Owner: Glaisher <glaisher.w...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to