public function onView() {
$content = '';
+ // Validate revision
+ $oldid = $this->page->getOldID();
+ if ( $oldid ) {
+ $revision = $this->page->getRevisionFetched();
+
+ // Revision is missing
+ if ( $revision === null ) {
+ return $this->msg( 'missing-revision', $oldid )->parse();
+ }
+
+ // Revision is not current
+ if ( !$revision->isCurrent() ) {
+ return $this->msg( 'pageinfo-not-current' )->plain();
+ }
+ }
+
// Page header
if ( !$this->msg( 'pageinfo-header' )->isDisabled() ) {
$content .= $this->msg( 'pageinfo-header' )->parse();
);
}
+ if ( !$this->page->exists() ) {
+ return $pageInfo;
+ }
+
// Edit history
$pageInfo['header-edits'] = array();
# Info page
'pageinfo-header' => '-', # do not translate or duplicate this message to other languages
'pageinfo-title' => 'Information for "$1"',
+'pageinfo-not-current' => 'Information may only be displayed for the current revision.',
'pageinfo-header-basic' => 'Basic information',
'pageinfo-header-edits' => 'Edit history',
'pageinfo-header-restrictions' => 'Page protection',
# Info page
'pageinfo-title' => 'Page title for action=info. Parameters:
* $1 is the page name',
+'pageinfo-not-current' => 'Error message displayed when information for an old revision is requested.',
'pageinfo-header-basic' => 'Table section header in action=info.',
'pageinfo-header-edits' => 'Table section header in action=info.',
'pageinfo-header-restrictions' => 'Table section header in action=info.',
'info' => array(
'pageinfo-header',
'pageinfo-title',
+ 'pageinfo-not-current',
'pageinfo-header-basic',
'pageinfo-header-edits',
'pageinfo-header-restrictions',