Fix Special: title in ApiVisualEditorEdit

We also do this in ApiVisualEditor.

Change-Id: I5c27c6e7770d0a5093684cadeaf1786f85dc32ff
This commit is contained in:
Ed Sanders 2019-12-20 15:50:48 +00:00
parent cf6ccfd058
commit 21b676452e

View file

@ -380,6 +380,10 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
$user = $this->getUser();
$params = $this->extractRequestParams();
$title = Title::newFromText( $params['page'] );
if ( $title && $title->isSpecial( 'CollabPad' ) ) {
// Convert Special:CollabPad/MyPage to MyPage so we can serialize properly
$title = SpecialCollabPad::getSubPage( $title );
}
if ( !$title ) {
$this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $params['page'] ) ] );
}