if ( $user->isBlocked() ) {
$status = SpecialBlock::checkUnblockSelf( $params['user'], $user );
if ( $status !== true ) {
if ( $user->isBlocked() ) {
$status = SpecialBlock::checkUnblockSelf( $params['user'], $user );
if ( $status !== true ) {
if ( $target instanceof User &&
( $target->isAnon() /* doesn't exist */ || !User::isUsableName( $target->getName() ) )
) {
if ( $target instanceof User &&
( $target->isAnon() /* doesn't exist */ || !User::isUsableName( $target->getName() ) )
) {
'PreviousTarget' => $params['user'],
'Target' => $params['user'],
'PreviousTarget' => $params['user'],
'Target' => $params['user'],
'Expiry' => $params['expiry'],
'HardBlock' => !$params['anononly'],
'CreateAccount' => $params['nocreate'],
'Expiry' => $params['expiry'],
'HardBlock' => !$params['anononly'],
'CreateAccount' => $params['nocreate'],
'Reblock' => $params['reblock'],
'Watch' => $params['watchuser'],
'Confirm' => true,
'Reblock' => $params['reblock'],
'Watch' => $params['watchuser'],
'Confirm' => true,
$retval = SpecialBlock::processForm( $data, $this->getContext() );
if ( $retval !== true ) {
$retval = SpecialBlock::processForm( $data, $this->getContext() );
if ( $retval !== true ) {
'action=block&user=192.0.2.5&expiry=3%20days&reason=First%20strike&token=123ABC'
=> 'apihelp-block-example-ip-simple',
'action=block&user=Vandal&expiry=never&reason=Vandalism&nocreate=&autoblock=&noemail=&token=123ABC'
=> 'apihelp-block-example-user-complex',
'action=block&user=192.0.2.5&expiry=3%20days&reason=First%20strike&token=123ABC'
=> 'apihelp-block-example-ip-simple',
'action=block&user=Vandal&expiry=never&reason=Vandalism&nocreate=&autoblock=&noemail=&token=123ABC'
=> 'apihelp-block-example-user-complex',