mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-12 01:16:19 +00:00
Merge "Emergency: discussiontoolspageinfo return empty response in non-talk ns"
This commit is contained in:
commit
0a5397b4b5
|
@ -42,6 +42,21 @@ class ApiDiscussionToolsPageInfo extends ApiBase {
|
|||
$params = $this->extractRequestParams();
|
||||
$this->requireAtLeastOneParameter( $params, 'page', 'oldid' );
|
||||
|
||||
if ( isset( $params['page'] ) ) {
|
||||
$title = Title::newFromText( $params['page'] );
|
||||
if ( !$title ) {
|
||||
$this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $params['page'] ) ] );
|
||||
}
|
||||
if ( !HookUtils::isAvailableForTitle( $title ) ) {
|
||||
$this->getResult()->addValue(
|
||||
null,
|
||||
$this->getModuleName(),
|
||||
[ 'transcludedfrom' => [] ]
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $params['oldid'] ) ) {
|
||||
$revision = $this->revisionLookup->getRevisionById( $params['oldid'] );
|
||||
if ( !$revision ) {
|
||||
|
|
Loading…
Reference in a new issue