X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiUndelete.php;h=ee5c3a2f54f833a16460c2019a74b70892834a1a;hp=7fda1ea01a400b1d278a25e7993500c10613c9e8;hb=a2c8c2969420a0f150c03f76e3a0bf9028fcda43;hpb=1676448145f28cdf5bf399b13a39d909d7e0bb77 diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index 7fda1ea01a..ee5c3a2f54 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -1,9 +1,5 @@ .@gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -33,7 +29,6 @@ class ApiUndelete extends ApiBase { $this->useTransactionalTimeLimit(); $params = $this->extractRequestParams(); - $this->checkUserRightsAny( 'undelete' ); $user = $this->getUser(); if ( $user->isBlocked() ) { @@ -45,6 +40,10 @@ class ApiUndelete extends ApiBase { $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $params['title'] ) ] ); } + if ( !$titleObj->userCan( 'undelete', $user, 'secure' ) ) { + $this->dieWithError( 'permdenied-undelete' ); + } + // Check if user can add tags if ( !is_null( $params['tags'] ) ) { $ableToTag = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $user ); @@ -145,6 +144,6 @@ class ApiUndelete extends ApiBase { } public function getHelpUrls() { - return 'https://www.mediawiki.org/wiki/API:Undelete'; + return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Undelete'; } }