X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=blobdiff_plain;f=includes%2Fapi%2FApiUndelete.php;h=9ef17e64df428e3a4fb7b3f0a8336bd4ccac0eda;hb=c05e0f7d945ca411aec6e24f9d9e69517cd37f8d;hp=5f9b97c457a68d82033a659423a7b3bd5596340c;hpb=751bac3786c561225f121b607189ccd865416e1b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index 5f9b97c457..9ef17e64df 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -41,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' ); } @@ -84,10 +84,12 @@ class ApiUndelete extends ApiBase { $this->setWatch( $params['watchlist'], $titleObj ); - $info['title'] = $titleObj->getPrefixedText(); - $info['revisions'] = (int)$retval[0]; - $info['fileversions'] = (int)$retval[1]; - $info['reason'] = $retval[2]; + $info = [ + 'title' => $titleObj->getPrefixedText(), + 'revisions' => (int)$retval[0], + 'fileversions' => (int)$retval[1], + 'reason' => $retval[2] + ]; $this->getResult()->addValue( null, $this->getModuleName(), $info ); }