diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php index df207d8ad..6c9958476 100644 --- a/AbuseFilter.class.php +++ b/AbuseFilter.class.php @@ -1187,7 +1187,13 @@ class AbuseFilter { $block->prevents( 'createaccount', true ); $block->prevents( 'editownusertalk', false ); - $expiry = $wgUser->isAnon() ? $wgAbuseFilterAnonBlockDuration : $wgAbuseFilterBlockDuration; + if ( $wgUser->isAnon() && $wgAbuseFilterAnonBlockDuration !== null ) { + // The user isn't logged in and the anon block duration doesn't default to $wgAbuseFilterBlockDuration + $expiry = $wgAbuseFilterAnonBlockDuration; + } else { + $expiry = $wgAbuseFilterBlockDuration; + } + $block->mExpiry = SpecialBlock::parseExpiryInput( $expiry ); $block->insert(); diff --git a/AbuseFilter.php b/AbuseFilter.php index 81391db82..556c44d97 100644 --- a/AbuseFilter.php +++ b/AbuseFilter.php @@ -187,8 +187,8 @@ $wgAbuseFilterDisallowGlobalLocalBlocks = false; // Block duration for logged in users $wgAbuseFilterBlockDuration = 'indefinite'; -// Block duration for anonymous users -$wgAbuseFilterAnonBlockDuration = $wgAbuseFilterBlockDuration; +// Block duration for anonymous users ($wgAbuseFilterBlockDuration will be used if null) +$wgAbuseFilterAnonBlockDuration = null; // Callback functions for custom actions $wgAbuseFilterCustomActionsHandlers = array();