X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiUndelete.php;h=469fe7f7e32b798f251fb2cc64eca71ab8b95915;hb=1e296da3d7da4bf095ae228d7f5890f7ef520873;hp=cd50ee65c721b272d9f0b739b270e722882cfd13;hpb=607a84af5f027c1a942cb5b2cd46a4958c5af7b0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index cd50ee65c7..469fe7f7e3 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -33,18 +33,13 @@ class ApiUndelete extends ApiBase { $this->useTransactionalTimeLimit(); $params = $this->extractRequestParams(); - - if ( !$this->getUser()->isAllowed( 'undelete' ) ) { + $user = $this->getUser(); + if ( !$user->isAllowed( 'undelete' ) ) { $this->dieUsageMsg( 'permdenied-undelete' ); } - if ( $this->getUser()->isBlocked() ) { - $this->dieUsage( - 'You have been blocked from editing', - 'blocked', - 0, - array( 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $this->getUser()->getBlock() ) ) - ); + if ( $user->isBlocked() ) { + $this->dieBlocked( $user->getBlock() ); } $titleObj = Title::newFromText( $params['title'] );