From: Aaron Schulz Date: Sat, 24 Jan 2009 06:01:59 +0000 (+0000) Subject: (bug 14423) Check flag validity for logging X-Git-Tag: 1.31.0-rc.0~43286 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=2b9ce837b05bc729211564e2552b7caa666d6a4f;p=lhc%2Fweb%2Fwiklou.git (bug 14423) Check flag validity for logging --- diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index a83f535328..6b60cd1bc0 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -404,7 +404,8 @@ class IPBlockForm { $block = new Block( $this->BlockAddress, $userId, $wgUser->getId(), $reasonstr, wfTimestampNow(), 0, $expiry, $this->BlockAnonOnly, $this->BlockCreateAccount, $this->BlockEnableAutoblock, $this->BlockHideName, - $this->BlockEmail, isset( $this->BlockAllowUsertalk ) ? $this->BlockAllowUsertalk : $wgBlockAllowsUTEdit ); + $this->BlockEmail, isset( $this->BlockAllowUsertalk ) ? $this->BlockAllowUsertalk : $wgBlockAllowsUTEdit + ); if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) { @@ -430,6 +431,10 @@ class IPBlockForm { if ( $this->BlockWatchUser ) { $wgUser->addWatch ( Title::makeTitle( NS_USER, $this->BlockAddress ) ); } + + # Block constructor sanitizes certain block options on insert + $this->BlockEmail = $block->mBlockEmail; + $this->BlockEnableAutoblock = $block->mEnableAutoblock; # Prepare log parameters $logParams = array(); @@ -500,7 +505,7 @@ class IPBlockForm { global $wgBlockAllowsUTEdit; $flags = array(); if( $this->BlockAnonOnly && IP::isIPAddress( $this->BlockAddress ) ) - // when blocking a user the option 'anononly' is not available/has no effect -> do not write this into log + // when blocking a user the option 'anononly' is not available/has no effect -> do not write this into log $flags[] = 'anononly'; if( $this->BlockCreateAccount ) $flags[] = 'nocreate';