* (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.

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.
This commit is contained in:
Brion Vibber 2007-06-27 15:30:43 +00:00
parent a9618297b9
commit 05b21233ff
3 changed files with 11 additions and 4 deletions

View 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 ==

View 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' );

View 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 ;
}