mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 09:43:30 +00:00
ApiDiscussionToolsCompare: Show nice error for deleted revisions
Bug: T362814 Change-Id: Iecc3e3737fcc82a79e699fe0bc00f373ecabf0c2
This commit is contained in:
parent
f3e96a72fa
commit
b8a28d6cfc
|
@ -55,6 +55,11 @@ class ApiDiscussionToolsCompare extends ApiBase {
|
|||
);
|
||||
}
|
||||
}
|
||||
// To keep things simple, don't allow viewing deleted revisions through this API
|
||||
// (even if the current user could view them if we checked with userCan()).
|
||||
if ( !$rev->audienceCan( RevisionRecord::DELETED_TEXT, RevisionRecord::FOR_PUBLIC ) ) {
|
||||
$this->dieWithError( [ 'apierror-missingcontent-revid', $rev->getId() ], 'missingcontent' );
|
||||
}
|
||||
return $rev;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue