Add check for page existence
[lhc/web/wiklou.git] / maintenance / view.php
index 952b825..b75fe5b 100644 (file)
@@ -39,6 +39,10 @@ class ViewCLI extends Maintenance {
                $title = Title::newFromText( $this->getArg() );
                if ( !$title ) {
                        $this->fatalError( "Invalid title" );
                $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 );
                }
 
                $page = WikiPage::factory( $title );