Index: trunk/extensions/AbuseFilter/AbuseFilter.php |
— | — | @@ -119,3 +119,5 @@ |
120 | 120 | $wgAbuseFilterCentralDB = null; |
121 | 121 | $wgAbuseFilterIsCentral = false; |
122 | 122 | |
| 123 | +// Block duration |
| 124 | +$wgAbuseFilterBlockDuration = 'indefinite'; |
Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php |
— | — | @@ -925,7 +925,7 @@ |
926 | 926 | break; |
927 | 927 | |
928 | 928 | case 'block': |
929 | | - global $wgUser; |
| 929 | + global $wgUser, $wgAbuseFilterBlockDuration; |
930 | 930 | $filterUser = AbuseFilter::getFilterUser(); |
931 | 931 | |
932 | 932 | // Create a block. |
— | — | @@ -938,14 +938,18 @@ |
939 | 939 | $block->mTimestamp = wfTimestampNow(); |
940 | 940 | $block->mAnonOnly = 1; |
941 | 941 | $block->mCreateAccount = 1; |
942 | | - $block->mExpiry = 'infinity'; |
| 942 | + $block->mExpiry = Block::parseExpiryInput( $wgAbuseFilterBlockDuration ); |
943 | 943 | |
944 | 944 | $block->insert(); |
945 | 945 | |
946 | 946 | // Log it |
947 | 947 | # Prepare log parameters |
948 | 948 | $logParams = array(); |
949 | | - $logParams[] = 'indefinite'; |
| 949 | + if ($block->mExpiry == 'infinity') { |
| 950 | + $logParams[] = 'indefinite'; |
| 951 | + } else { |
| 952 | + $logParams[] = $wgAbuseFilterBlockDuration; |
| 953 | + } |
950 | 954 | $logParams[] = 'nocreate, angry-autoblock'; |
951 | 955 | |
952 | 956 | $log = new LogPage( 'block' ); |