From 3191a0b042ec3b375924c9e047974ac7dd1f68ef Mon Sep 17 00:00:00 2001 From: JuneHyeon Bae Date: Fri, 30 May 2014 18:14:54 +0900 Subject: [PATCH] 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 --- includes/specials/SpecialBlock.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.20.1