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

Change subject: Throw PermissionsError exception directly
......................................................................


Throw PermissionsError exception directly

Change-Id: I297f204fe0589a70075c1aa96c6c88f1397ce3d9
---
M AuthorProtect.php
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/AuthorProtect.php b/AuthorProtect.php
index 4c289ca..78b5296 100644
--- a/AuthorProtect.php
+++ b/AuthorProtect.php
@@ -110,8 +110,7 @@
                }
                global $wgOut, $wgUser, $wgRequest, $wgRestrictionTypes;
                if ( !$wgUser->isAllowed( 'authorprotect' ) ) {
-                       $wgOut->permissionRequired( 'authorprotect' );
-                       return false;
+                       throw new PermissionsError( 'authorprotect' );
                }
                if ( !self::userIsAuthor( $article->getTitle() ) ) {
                        $wgOut->setPageTitle( wfMessage( 'errorpagetitle' ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I297f204fe0589a70075c1aa96c6c88f1397ce3d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AuthorProtect
Gerrit-Branch: master
Gerrit-Owner: Reedy <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to