* (bug 7071) Properly handle an 'oldid' passed to view or edit that doesn't
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 27 Jun 2007 15:30:43 +0000 (15:30 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 27 Jun 2007 15:30:43 +0000 (15:30 +0000)
  match the given title. Fixes inconsistencies with talk, history, edit links.

This reverts r23445 and moves the check upstream into the title setup at
MediaWiki::checkInitialQueries(). As the most specific identifier which can
be passed, the revision title listed for the oldid (if any) trumps both
'title' and 'curid' parameters.

RELEASE-NOTES
includes/Article.php
includes/Wiki.php

index 3baf3b9..c450bf5 100644 (file)
@@ -218,6 +218,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * namespaceDupes.php should work better for initial-lowercase wikis
 * (bug 10377) "Permanent links" to revisions still work if the page is moved
   and the redirect deleted
+* (bug 7071) Properly handle an 'oldid' passed to view or edit that doesn't
+  match the given title. Fixes inconsistencies with talk, history, edit links.
+
 
 == API changes since 1.10 ==
 
index 50fca0b..5c325c5 100644 (file)
@@ -141,10 +141,7 @@ class Article {
 
                wfProfileIn( __METHOD__ );
 
-               // We want to show the content even if the page doesn't exist, as long
-               // as the revision does (perhaps it's been moved and the redirect
-               // deleted: bug 10377)
-               if ( 0 == $this->getID() and !$this->mOldId ) {
+               if ( 0 == $this->getID() ) {
                        wfProfileOut( __METHOD__ );
                        $wgOut->setRobotpolicy( 'noindex,nofollow' );
 
index 601a722..a9537a7 100644 (file)
@@ -98,6 +98,13 @@ class MediaWiki {
                                $lang->findVariantLink( $title, $ret );
 
                }
+               if ( $oldid = $request->getInt( 'oldid' ) ) {
+                       // Allow oldid to override a changed or missing title.
+                       $rev = Revision::newFromId( $oldid );
+                       if( $rev ) {
+                               $ret = $rev->getTitle();
+                       }
+               }
                return $ret ;
        }