From 5478ace070639f320e8972183c73d1ba5ec31349 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 18 Mar 2006 22:23:50 +0000 Subject: [PATCH] * (bug 5286) Fix regression in display of missing/bad revision IDs --- RELEASE-NOTES | 2 ++ includes/Article.php | 22 +++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3d18e3e29a..e282a778d9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -704,6 +704,8 @@ fully support the editing toolbar, but was found to be too confusing. * Don't URL-decode in the title attribute for URL links; it can produce false results that don't code back to their original values. * (bug 4611) Add user preference (default on) to add new pages to creators's watchlist +* (bug 5286) Fix regression in display of missing/bad revision IDs + === Caveats === diff --git a/includes/Article.php b/includes/Article.php index ad11b2f0d9..cdfe6434d3 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -848,16 +848,20 @@ class Article { # We're looking at an old revision if ( !empty( $oldid ) ) { - $this->setOldSubtitle( isset($this->mOldId) ? $this->mOldId : $oldid ); $wgOut->setRobotpolicy( 'noindex,nofollow' ); - if( $this->mRevision->isDeleted( MW_REV_DELETED_TEXT ) ) { - if( !$this->mRevision->userCan( MW_REV_DELETED_TEXT ) ) { - $wgOut->addWikiText( wfMsg( 'rev-deleted-text-permission' ) ); - $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); - return; - } else { - $wgOut->addWikiText( wfMsg( 'rev-deleted-text-view' ) ); - // and we are allowed to see... + if( is_null( $this->mRevision ) ) { + // FIXME: This would be a nice place to load the 'no such page' text. + } else { + $this->setOldSubtitle( isset($this->mOldId) ? $this->mOldId : $oldid ); + if( $this->mRevision->isDeleted( MW_REV_DELETED_TEXT ) ) { + if( !$this->mRevision->userCan( MW_REV_DELETED_TEXT ) ) { + $wgOut->addWikiText( wfMsg( 'rev-deleted-text-permission' ) ); + $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); + return; + } else { + $wgOut->addWikiText( wfMsg( 'rev-deleted-text-view' ) ); + // and we are allowed to see... + } } } -- 2.20.1