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

Change subject: Check for global blocks in addition to regular ones before 
showing the wizard
......................................................................


Check for global blocks in addition to regular ones before showing the wizard

Code adapted from VisualEditor.

Bug: T111174
Change-Id: I627c4a3c8ddca2429e61a05eef933ddc22b5e5a3
---
M includes/specials/SpecialUploadWizard.php
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialUploadWizard.php 
b/includes/specials/SpecialUploadWizard.php
index b46dc95..5bff0ed 100644
--- a/includes/specials/SpecialUploadWizard.php
+++ b/includes/specials/SpecialUploadWizard.php
@@ -309,6 +309,17 @@
                        throw new UserBlockedError( $this->getUser()->mBlock );
                }
 
+               // Global blocks
+               if ( class_exists( 'GlobalBlocking' ) ) {
+                       $error = GlobalBlocking::getUserBlockErrors(
+                               $user,
+                               $this->getRequest()->getIP()
+                       );
+                       if ( count( $error ) ) {
+                               throw new ErrorPageError( 'blockedtitle', 
array_shift( $error ), $error );
+                       }
+               }
+
                // we got all the way here, so it must be okay to upload
                return true;
        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I627c4a3c8ddca2429e61a05eef933ddc22b5e5a3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Glaisher <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to