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.
* 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 ==
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' );
$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 ;
}