// 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));
'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.