From: JuneHyeon Bae Date: Fri, 30 May 2014 09:14:54 +0000 (+0900) Subject: Warn when user trying to block nonexistent user X-Git-Tag: 1.31.0-rc.0~12289^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=3191a0b042ec3b375924c9e047974ac7dd1f68ef;p=lhc%2Fweb%2Fwiklou.git Warn when user trying to block nonexistent user Now, Special:Block/Some_User and Special:Block/No_Such_User act the same. So show warning when user opened 'Special:Block/No_such_user' page. Bug: T37687 Change-Id: I60292e1016b64224a6146add58106c9028e7914c --- diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index efe4888fc5..c67281736c 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -236,6 +236,14 @@ class SpecialBlock extends FormSpecialPage { # This will be overwritten by request data $fields['Target']['default'] = (string)$this->target; + if ( $this->target ) { + $status = self::validateTarget( $this->target, $this->getUser() ); + if ( !$status->isOK() ) { + $errors = $status->getErrorsArray(); + $this->preErrors = array_merge( $this->preErrors, $errors ); + } + } + # This won't be $fields['PreviousTarget']['default'] = (string)$this->target;