Currently even if the page does not exist at all this script just says
"there's no content" which is partially true. If the page does exist but with
no content and/or blank the same answer is also given, which is OK in that case
but less so in the former case.
Also handle special pages instead of throwing exception.
Change-Id: Ia15b336d989d3605ead1891e3396380e8e6d4347
$title = Title::newFromText( $this->getArg() );
if ( !$title ) {
$this->fatalError( "Invalid title" );
+ } elseif ( $title->isSpecialPage() ) {
+ $this->fatalError( "Special Pages not supported" );
+ } elseif ( !$title->exists() ) {
+ $this->fatalError( "Page does not exist" );
}
$page = WikiPage::factory( $title );