Add check for page existence
[lhc/web/wiklou.git] / maintenance / view.php
index 8683eed..81c3f3e 100644 (file)
@@ -41,6 +41,10 @@ class ViewCLI extends Maintenance {
                $title = Title::newFromText( $this->getArg( 0 ) );
                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 );