From 4f1a00a64a17f067fa6bd6b3dd8e73908fcfaee6 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 9 Jun 2008 01:15:14 +0000 Subject: [PATCH] Hidden blocks should be permanent only --- includes/SpecialBlockip.php | 9 +++++++-- languages/messages/MessagesEn.php | 1 + maintenance/language/messages.inc | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index 903c116a62..5ea25ca46a 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -347,15 +347,20 @@ class IPBlockForm { // Bad expiry. return array('ipb_expiry_invalid'); } + + if( $this->BlockHideName && $expiry != 'infinity' ) { + // Bad expiry. + return array('ipb_expiry_temp'); + } # Create block # Note: for a user block, ipb_address is only for display purposes $block = new Block( $this->BlockAddress, $userId, $wgUser->getId(), $reasonstr, wfTimestampNow(), 0, $expiry, $this->BlockAnonOnly, $this->BlockCreateAccount, $this->BlockEnableAutoblock, $this->BlockHideName, - $this->BlockEmail); + $this->BlockEmail ); - if (wfRunHooks('BlockIp', array(&$block, &$wgUser))) { + if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) { if ( !$block->insert() ) { return array('ipb_already_blocked', htmlspecialchars($this->BlockAddress)); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index cf36f66280..156cd2e3bd 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2361,6 +2361,7 @@ See the [[Special:Ipblocklist|IP block list]] for the list of currently operatio 'block-log-flags-noemail' => 'e-mail blocked', 'range_block_disabled' => 'The sysop ability to create range blocks is disabled.', 'ipb_expiry_invalid' => 'Expiry time invalid.', +'ipb_expiry_temp' => 'Hidden username blocks should be permanent.', 'ipb_already_blocked' => '"$1" is already blocked', 'ipb_cant_unblock' => 'Error: Block ID $1 not found. It may have been unblocked already.', 'ipb_blocked_as_range' => 'Error: The IP $1 is not blocked directly and cannot be unblocked. diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 039b59d873..dd83e4193d 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1616,6 +1616,7 @@ $wgMessageStructure = array( 'block-log-flags-noemail', 'range_block_disabled', 'ipb_expiry_invalid', + 'ipb_expiry_temp', 'ipb_already_blocked', 'ipb_modifying_block', 'ipb_cant_unblock', -- 2.20.1