X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryFilearchive.php;h=116dbb3d34db525a33d8039d89beb922119922bb;hb=3287201b673c6e52c04e9f8771c0e71d1a617910;hp=03be491e7cc17d08695cde64a7a81c2471b23026;hpb=58cb1f824ac75c3b58ba19d1e88c1b38f9dc1fab;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryFilearchive.php b/includes/api/ApiQueryFilearchive.php index 03be491e7c..116dbb3d34 100644 --- a/includes/api/ApiQueryFilearchive.php +++ b/includes/api/ApiQueryFilearchive.php @@ -38,15 +38,10 @@ class ApiQueryFilearchive extends ApiQueryBase { } public function execute() { - $user = $this->getUser(); // Before doing anything at all, let's check permissions - if ( !$user->isAllowed( 'deletedhistory' ) ) { - $this->dieUsage( - 'You don\'t have permission to view deleted file information', - 'permissiondenied' - ); - } + $this->checkUserRightsAny( 'deletedhistory' ); + $user = $this->getUser(); $db = $this->getDB(); $params = $this->extractRequestParams(); @@ -112,13 +107,13 @@ class ApiQueryFilearchive extends ApiQueryBase { if ( $sha1Set ) { $sha1 = strtolower( $params['sha1'] ); if ( !$this->validateSha1Hash( $sha1 ) ) { - $this->dieUsage( 'The SHA1 hash provided is not valid', 'invalidsha1hash' ); + $this->dieWithError( 'apierror-invalidsha1hash' ); } $sha1 = Wikimedia\base_convert( $sha1, 16, 36, 31 ); } elseif ( $sha1base36Set ) { $sha1 = strtolower( $params['sha1base36'] ); if ( !$this->validateSha1Base36Hash( $sha1 ) ) { - $this->dieUsage( 'The SHA1Base36 hash provided is not valid', 'invalidsha1base36hash' ); + $this->dieWithError( 'apierror-invalidsha1base36hash' ); } } if ( $sha1 ) {