X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Fview.php;h=81c3f3e0ac07524557a7491b7f69f965b7b69702;hb=b1f648042f08a33314861f4cd22758dc02068f46;hp=671369aff9989b041ca751fce8fb6129fa607990;hpb=09ee5d2505f99cc146f871307be7ac00b7368d76;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/view.php b/maintenance/view.php index 671369aff9..81c3f3e0ac 100644 --- a/maintenance/view.php +++ b/maintenance/view.php @@ -21,6 +21,8 @@ * @ingroup Maintenance */ +use MediaWiki\Revision\RevisionRecord; + require_once __DIR__ . '/Maintenance.php'; /** @@ -39,11 +41,15 @@ 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 ); - $content = $page->getContent( Revision::RAW ); + $content = $page->getContent( RevisionRecord::RAW ); if ( !$content ) { $this->fatalError( "Page has no content" ); }