dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
API: Use ConvertibleTimestamp::setFakeTime for testing curtimestamp
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiRevisionDelete.php
diff --git
a/includes/api/ApiRevisionDelete.php
b/includes/api/ApiRevisionDelete.php
index
c636ba1
..
60b24f0
100644
(file)
--- a/
includes/api/ApiRevisionDelete.php
+++ b/
includes/api/ApiRevisionDelete.php
@@
-38,10
+38,6
@@
class ApiRevisionDelete extends ApiBase {
$user = $this->getUser();
$this->checkUserRightsAny( RevisionDeleter::getRestriction( $params['type'] ) );
$user = $this->getUser();
$this->checkUserRightsAny( RevisionDeleter::getRestriction( $params['type'] ) );
- if ( $user->isBlocked() ) {
- $this->dieBlocked( $user->getBlock() );
- }
-
if ( !$params['ids'] ) {
$this->dieWithError( [ 'apierror-paramempty', 'ids' ], 'paramempty_ids' );
}
if ( !$params['ids'] ) {
$this->dieWithError( [ 'apierror-paramempty', 'ids' ], 'paramempty_ids' );
}
@@
-95,6
+91,10
@@
class ApiRevisionDelete extends ApiBase {
$this->dieWithError( [ 'apierror-revdel-needtarget' ], 'needtarget' );
}
$this->dieWithError( [ 'apierror-revdel-needtarget' ], 'needtarget' );
}
+ if ( $this->getPermissionManager()->isBlockedFrom( $user, $targetObj ) ) {
+ $this->dieBlocked( $user->getBlock() );
+ }
+
$list = RevisionDeleter::createList(
$params['type'], $this->getContext(), $targetObj, $params['ids']
);
$list = RevisionDeleter::createList(
$params['type'], $this->getContext(), $targetObj, $params['ids']
);
@@
-116,7
+116,6
@@
class ApiRevisionDelete extends ApiBase {
}
$list->reloadFromMaster();
}
$list->reloadFromMaster();
- // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $item = $list->reset(); $list->current(); $item = $list->next() ) {
$data['items'][$item->getId()] += $item->getApiData( $this->getResult() );
}
for ( $item = $list->reset(); $list->current(); $item = $list->next() ) {
$data['items'][$item->getId()] += $item->getApiData( $this->getResult() );
}