From 2b9ce837b05bc729211564e2552b7caa666d6a4f Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 24 Jan 2009 06:01:59 +0000 Subject: [PATCH] (bug 14423) Check flag validity for logging --- includes/specials/SpecialBlockip.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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'; -- 2.20.1