r23483 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23482‎ | r23483 | r23484 >
Date:15:30, 27 June 2007
Author:brion
Status:old
Tags:
Comment:
* (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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -141,10 +141,7 @@
142142
143143 wfProfileIn( __METHOD__ );
144144
145 - // We want to show the content even if the page doesn't exist, as long
146 - // as the revision does (perhaps it's been moved and the redirect
147 - // deleted: bug 10377)
148 - if ( 0 == $this->getID() and !$this->mOldId ) {
 145+ if ( 0 == $this->getID() ) {
149146 wfProfileOut( __METHOD__ );
150147 $wgOut->setRobotpolicy( 'noindex,nofollow' );
151148
Index: trunk/phase3/includes/Wiki.php
@@ -98,6 +98,13 @@
9999 $lang->findVariantLink( $title, $ret );
100100
101101 }
 102+ if ( $oldid = $request->getInt( 'oldid' ) ) {
 103+ // Allow oldid to override a changed or missing title.
 104+ $rev = Revision::newFromId( $oldid );
 105+ if( $rev ) {
 106+ $ret = $rev->getTitle();
 107+ }
 108+ }
102109 return $ret ;
103110 }
104111
Index: trunk/phase3/RELEASE-NOTES
@@ -218,7 +218,10 @@
219219 * namespaceDupes.php should work better for initial-lowercase wikis
220220 * (bug 10377) "Permanent links" to revisions still work if the page is moved
221221 and the redirect deleted
 222+* (bug 7071) Properly handle an 'oldid' passed to view or edit that doesn't
 223+ match the given title. Fixes inconsistencies with talk, history, edit links.
222224
 225+
223226 == API changes since 1.10 ==
224227
225228 (For ongoing development discussion, see http://www.mediawiki.org/wiki/API)

Follow-up revisions

RevisionCommit summaryAuthorDate
r23581Merged revisions 23406-23580 via svnmerge from...david04:50, 30 June 2007

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r23445(bug 10377) "Permanent links" to revisions still work if the page is moved an...simetrical01:01, 27 June 2007

Status & tagging log