mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks
synced 2024-11-15 02:54:23 +00:00
Security: Disable thank when the user is globally blocked
Bug: T151910 Change-Id: I3f39dd32cb76d1a20c8711d5de88e8fcbc36507d
This commit is contained in:
parent
e059f99e82
commit
8ca5464a16
|
@ -13,6 +13,8 @@ abstract class ApiThank extends ApiBase {
|
|||
$this->dieWithError( [ 'thanks-error-ratelimited', $user->getName() ], 'ratelimited' );
|
||||
} elseif ( $user->isBlocked() ) {
|
||||
$this->dieBlocked( $user->getBlock() );
|
||||
} elseif ( $user->isBlockedGlobally() ) {
|
||||
$this->dieBlocked( $user->getGlobalBlock() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ class ThanksHooks {
|
|||
if ( !$user->isAnon()
|
||||
&& $recipientId !== $user->getId()
|
||||
&& !$user->isBlocked()
|
||||
&& !$user->isBlockedGlobally()
|
||||
&& self::canReceiveThanks( $recipient )
|
||||
&& !$rev->isDeleted( Revision::DELETED_TEXT )
|
||||
&& ( !$oldRev || $rev->getParentId() == $oldRev->getId() )
|
||||
|
@ -383,7 +384,7 @@ class ThanksHooks {
|
|||
global $wgUser;
|
||||
|
||||
// Don't thank if anonymous or blocked
|
||||
if ( $wgUser->isAnon() || $wgUser->isBlocked() ) {
|
||||
if ( $wgUser->isAnon() || $wgUser->isBlocked() || $wgUser->isBlockedGlobally() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue