From: Reedy Date: Tue, 23 Oct 2012 14:46:17 +0000 (+0100) Subject: Don't try and run a special page through action=parsex X-Git-Tag: 1.31.0-rc.0~21903^2 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=64075bb99022642643a94aa344333e7ec807c9e4;p=lhc%2Fweb%2Fwiklou.git Don't try and run a special page through action=parsex Change-Id: I1b4ca09b1674dbbde91acc6cade4dc1ff810bee5 --- diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 870fba9a28..37cab047d9 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -165,6 +165,9 @@ class ApiParse extends ApiBase { if ( !$titleObj ) { $this->dieUsageMsg( array( 'invalidtitle', $title ) ); } + if ( $titleObj->isSpecialPage() ) { + $this->dieUsage( 'Special pages cannot be parsed through action=parse', 'targetisspecial' ); + } $wgTitle = $titleObj; $pageObj = WikiPage::factory( $titleObj ); @@ -652,6 +655,7 @@ class ApiParse extends ApiBase { array( 'invalidtitle', 'title' ), array( 'code' => 'parseerror', 'info' => 'Failed to parse the given text.' ), array( 'code' => 'notwikitext', 'info' => 'The requested operation is only supported on wikitext content.' ), + array( 'code' => 'targetisspecial', 'info' => 'Special pages cannot be parsed through action=parse' ), ) ); }