*/
$wgDeleteRevisionsLimit = 0;
+/**
+ * The maximum number of edits a user can have and
+ * can still be hidden by users with the hideuser permission.
+ * This is limited for performance reason.
+ * Set to false to disable the limit.
+ * @since 1.23
+ */
+$wgHideUserContribLimit = 1000;
+
/**
* Number of accounts each IP address may create, 0 to disable.
*
* @ingroup SpecialPage
*/
class SpecialBlock extends FormSpecialPage {
- /** The maximum number of edits a user can have and still be hidden
- * TODO: config setting? */
- const HIDEUSER_CONTRIBLIMIT = 1000;
-
/** @var User user to be blocked, as passed either by parameter (url?wpTarget=Foo)
* or as subpage (Special:Block/Foo) */
protected $target;
* @return Bool|String
*/
public static function processForm( array $data, IContextSource $context ) {
- global $wgBlockAllowsUTEdit;
+ global $wgBlockAllowsUTEdit, $wgHideUserContribLimit;
$performer = $context->getUser();
} elseif ( !in_array( $data['Expiry'], array( 'infinite', 'infinity', 'indefinite' ) ) ) {
# Bad expiry.
return array( 'ipb_expiry_temp' );
- } elseif ( $user->getEditCount() > self::HIDEUSER_CONTRIBLIMIT ) {
+ } elseif ( $wgHideUserContribLimit !== false
+ && $user->getEditCount() > $wgHideUserContribLimit
+ ) {
# Typically, the user should have a handful of edits.
# Disallow hiding users with many edits for performance.
- return array( 'ipb_hide_invalid' );
+ return array( array( 'ipb_hide_invalid',
+ Message::numParam( $wgHideUserContribLimit ) ) );
} elseif ( !$data['Confirm'] ) {
return array( 'ipb-confirmhideuser', 'ipb-confirmaction' );
}
'range_block_disabled' => 'The administrator ability to create range blocks is disabled.',
'ipb_expiry_invalid' => 'Expiry time invalid.',
'ipb_expiry_temp' => 'Hidden username blocks must be permanent.',
-'ipb_hide_invalid' => 'Unable to suppress this account; it may have too many edits.',
+'ipb_hide_invalid' => 'Unable to suppress this account; it has more than {{PLURAL:$1|one edit|$1 edits}}.',
'ipb_already_blocked' => '"$1" is already blocked.',
'ipb-needreblock' => '$1 is already blocked. Do you want to change the settings?',
'ipb-otherblocks-header' => 'Other {{PLURAL:$1|block|blocks}}',
* {{msg-mw|Ip range toolarge}}',
'ipb_expiry_invalid' => 'Used as error message in [[Special:Block]].',
'ipb_expiry_temp' => 'Warning message displayed on [[Special:BlockIP]] if the option "hide username" is selected but the expiry time is not infinite.',
-'ipb_hide_invalid' => 'Used as error message in [[Special:Block]].',
+'ipb_hide_invalid' => 'Used as error message in [[Special:Block]].
+* $1 - Number of edits (Value of [[mw:Manual:$wgHideUserContribLimit]])',
'ipb_already_blocked' => '{{Identical|$1 is already blocked}}',
'ipb-needreblock' => 'Used in [[Special:Block]].
* $1 - target username',