X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiUndelete.php;h=ba9be81beacb6c7cc525ec7abaa2c154f46f2868;hb=616525021b3691e30a980a42b837b7ad44ecfd09;hp=07a6aae9eb6572e60276863d5d2b5eb7a856ce17;hpb=8022558024f5f9cf5383beb49937a75348982ca8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index 07a6aae9eb..ba9be81bea 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -31,7 +31,8 @@ class ApiUndelete extends ApiBase { $params = $this->extractRequestParams(); $user = $this->getUser(); - if ( $user->isBlocked() ) { + $block = $user->getBlock(); + if ( $block && $block->isSitewide() ) { $this->dieBlocked( $user->getBlock() ); } @@ -40,7 +41,7 @@ class ApiUndelete extends ApiBase { $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $params['title'] ) ] ); } - if ( !$titleObj->userCan( 'undelete', $user, 'secure' ) ) { + if ( !$this->getPermissionManager()->userCan( 'undelete', $this->getUser(), $titleObj ) ) { $this->dieWithError( 'permdenied-undelete' ); }