Merge "UserTest: Cover User::isIP and User::isValidUserName better"
[lhc/web/wiklou.git] / includes / specials / SpecialBlock.php
index e0ebd4d..8c46a93 100644 (file)
@@ -84,7 +84,8 @@ class SpecialBlock extends FormSpecialPage {
                        $this->getSkin()->setRelevantUser( $this->target );
                }
 
-               list( $this->previousTarget, /*...*/ ) = Block::parseTarget( $request->getVal( 'wpPreviousTarget' ) );
+               list( $this->previousTarget, /*...*/ ) =
+                       Block::parseTarget( $request->getVal( 'wpPreviousTarget' ) );
                $this->requestedHideUser = $request->getBool( 'wpHideUser' );
        }
 
@@ -128,8 +129,7 @@ class SpecialBlock extends FormSpecialPage {
                $a = array(
                        'Target' => array(
                                'type' => 'text',
-                               'label-message' => 'ipadressorusername',
-                               'tabindex' => '1',
+                               'label-message' => 'ipaddressorusername',
                                'id' => 'mw-bi-target',
                                'size' => '45',
                                'autofocus' => true,
@@ -140,7 +140,6 @@ class SpecialBlock extends FormSpecialPage {
                                'type' => !count( $suggestedDurations ) ? 'text' : 'selectorother',
                                'label-message' => 'ipbexpiry',
                                'required' => true,
-                               'tabindex' => '2',
                                'options' => $suggestedDurations,
                                'other' => $this->msg( 'ipbother' )->text(),
                                'default' => $this->msg( 'ipb-default-expiry' )->inContentLanguage()->text(),
@@ -361,7 +360,10 @@ class SpecialBlock extends FormSpecialPage {
 
                # Link to unblock the specified user, or to a blank unblock form
                if ( $this->target instanceof User ) {
-                       $message = $this->msg( 'ipb-unblock-addr', wfEscapeWikiText( $this->target->getName() ) )->parse();
+                       $message = $this->msg(
+                               'ipb-unblock-addr',
+                               wfEscapeWikiText( $this->target->getName() )
+                       )->parse();
                        $list = SpecialPage::getTitleFor( 'Unblock', $this->target->getName() );
                } else {
                        $message = $this->msg( 'ipb-unblock' )->parse();
@@ -451,7 +453,7 @@ class SpecialBlock extends FormSpecialPage {
 
        /**
         * Determine the target of the block, and the type of target
-        * TODO: should be in Block.php?
+        * @todo Should be in Block.php?
         * @param string $par subpage parameter passed to setup, or data value from
         *     the HTMLForm
         * @param WebRequest $request Optionally try and get data from a request too
@@ -765,7 +767,11 @@ class SpecialBlock extends FormSpecialPage {
 
                # Can't watch a rangeblock
                if ( $type != Block::TYPE_RANGE && $data['Watch'] ) {
-                       WatchAction::doWatch( Title::makeTitle( NS_USER, $target ), $performer, WatchedItem::IGNORE_USER_RIGHTS );
+                       WatchAction::doWatch(
+                               Title::makeTitle( NS_USER, $target ),
+                               $performer,
+                               WatchedItem::IGNORE_USER_RIGHTS
+                       );
                }
 
                # Block constructor sanitizes certain block options on insert
@@ -969,7 +975,3 @@ class SpecialBlock extends FormSpecialPage {
                return 'users';
        }
 }
-
-# BC @since 1.18
-class IPBlockForm extends SpecialBlock {
-}