diff --git a/includes/ApiDiscussionToolsPageInfo.php b/includes/ApiDiscussionToolsPageInfo.php index 07d48011b..e50015c1c 100644 --- a/includes/ApiDiscussionToolsPageInfo.php +++ b/includes/ApiDiscussionToolsPageInfo.php @@ -12,6 +12,7 @@ use MediaWiki\Extension\DiscussionTools\ThreadItem\ContentHeadingItem; use MediaWiki\Extension\DiscussionTools\ThreadItem\ContentThreadItem; use MediaWiki\Extension\VisualEditor\VisualEditorParsoidClientFactory; use MediaWiki\Revision\RevisionLookup; +use MediaWiki\Revision\RevisionRecord; use MediaWiki\Title\Title; use Wikimedia\ParamValidator\ParamValidator; use Wikimedia\Parsoid\Core\ResourceLimitExceededException; @@ -112,6 +113,10 @@ class ApiDiscussionToolsPageInfo extends ApiBase { return new ContentThreadItemSet; } + if ( !$revision->audienceCan( RevisionRecord::DELETED_TEXT, RevisionRecord::FOR_PUBLIC ) ) { + $this->dieWithError( [ 'apierror-missingcontent-revid', $revision->getId() ], 'missingcontent' ); + } + try { return HookUtils::parseRevisionParsoidHtml( $revision, __METHOD__ ); } catch ( ResourceLimitExceededException $e ) {