X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiBlock.php;h=85dd2c7f3919422abacd112ee4d85ce81786b8ab;hp=df30a2de7576ca0ffc3dd5f5d4846046ac9383a8;hb=816ac899a7087a79e1d23b5efe867987e6dc3233;hpb=63eebc01c48aee45f9c219cadf2e0e81f5a2043e diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index df30a2de75..85dd2c7f39 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -1,9 +1,5 @@ .@gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -113,6 +109,11 @@ class ApiBlock extends ApiBase { 'Tags' => $params['tags'], ]; + $status = SpecialBlock::validateTarget( $params['user'], $user ); + if ( !$status->isOK() ) { + $this->dieStatus( $status ); + } + $retval = SpecialBlock::processForm( $data, $this->getContext() ); if ( $retval !== true ) { $this->dieStatus( $this->errorArrayToStatus( $retval ) ); @@ -128,8 +129,8 @@ class ApiBlock extends ApiBase { $res['id'] = $block->getId(); } else { # should be unreachable - $res['expiry'] = ''; - $res['id'] = ''; + $res['expiry'] = ''; // @codeCoverageIgnore + $res['id'] = ''; // @codeCoverageIgnore } $res['reason'] = $params['reason'];