* (bug 5286) Fix regression in display of missing/bad revision IDs
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 18 Mar 2006 22:23:50 +0000 (22:23 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 18 Mar 2006 22:23:50 +0000 (22:23 +0000)
RELEASE-NOTES
includes/Article.php

index 3d18e3e..e282a77 100644 (file)
@@ -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 ===
 
index ad11b2f..cdfe643 100644 (file)
@@ -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...
+                                               }
                                        }
                                }