Merge "Make setUp and tearDown protected in tests"
[lhc/web/wiklou.git] / includes / specials / SpecialBlock.php
index 645de23..3b73a37 100644 (file)
@@ -127,6 +127,8 @@ class SpecialBlock extends FormSpecialPage {
 
                $user = $this->getUser();
 
+               $suggestedDurations = self::getSuggestedDurations();
+
                $a = array(
                        'Target' => array(
                                'type' => 'text',
@@ -139,11 +141,11 @@ class SpecialBlock extends FormSpecialPage {
                                'validation-callback' => array( __CLASS__, 'validateTargetField' ),
                        ),
                        'Expiry' => array(
-                               'type' => !count( self::getSuggestedDurations() ) ? 'text' : 'selectorother',
+                               'type' => !count( $suggestedDurations ) ? 'text' : 'selectorother',
                                'label-message' => 'ipbexpiry',
                                'required' => true,
                                'tabindex' => '2',
-                               'options' => self::getSuggestedDurations(),
+                               'options' => $suggestedDurations,
                                'other' => $this->msg( 'ipbother' )->text(),
                                'default' => $this->msg( 'ipb-default-expiry' )->inContentLanguage()->text(),
                        ),
@@ -751,7 +753,7 @@ class SpecialBlock extends FormSpecialPage {
 
                # Can't watch a rangeblock
                if ( $type != Block::TYPE_RANGE && $data['Watch'] ) {
-                       $performer->addWatch( Title::makeTitle( NS_USER, $target ) );
+                       WatchAction::doWatch( Title::makeTitle( NS_USER, $target ), $performer, WatchedItem::IGNORE_USER_RIGHTS );
                }
 
                # Block constructor sanitizes certain block options on insert
@@ -770,7 +772,8 @@ class SpecialBlock extends FormSpecialPage {
                        $logaction,
                        Title::makeTitle( NS_USER, $target ),
                        $data['Reason'][0],
-                       $logParams
+                       $logParams,
+                       $performer
                );
                # Relate log ID to block IDs (bug 25763)
                $blockIds = array_merge( array( $status['id'] ), $status['autoIds'] );