Merge "Performance: don't check autopromotion if blockautopromote is disabled"

This commit is contained in:
jenkins-bot 2020-10-21 13:20:13 +00:00 committed by Gerrit Code Review
commit f5950e638f

View file

@ -263,7 +263,9 @@ class AbuseFilterHooks {
* @param array &$promote
*/
public static function onGetAutoPromoteGroups( User $user, &$promote ) {
if ( $promote ) {
global $wgAbuseFilterActions;
if ( ( $wgAbuseFilterActions['blockautopromote'] ?? false ) && $promote ) {
$cache = ObjectCache::getInstance( 'hash' );
$key = AbuseFilter::autoPromoteBlockKey( $cache, $user );
$blocked = (bool)$cache->getWithSetCallback(