r45458 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45457‎ | r45458 | r45459 >
Date:20:54, 6 January 2009
Author:aaron
Status:reverted (Comments)
Tags:
Comment:
Fix diff= urls with no title (bug 15233)
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -115,11 +115,12 @@
116116 if( count( $wgContLang->getVariants() ) > 1 && !is_null( $ret ) && $ret->getArticleID() == 0 )
117117 $wgContLang->findVariantLink( $title, $ret );
118118 }
119 - if( ( $oldid = $wgRequest->getInt( 'oldid' ) )
120 - && ( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) ) {
121 - // Allow oldid to override a changed or missing title.
122 - $rev = Revision::newFromId( $oldid );
123 - if( $rev ) {
 119+ if( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) {
 120+ $oldid = $wgRequest->getInt( 'oldid' );
 121+ if( !$oldid )
 122+ $oldid = $wgRequest->getInt( 'diff' );
 123+ // Allow oldid to override a changed or missing title
 124+ if( $oldid && ( $rev = Revision::newFromId( $oldid ) ) ) {
124125 $ret = $rev->getTitle();
125126 }
126127 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r45486Pull back r45458 "Fix diff= urls with no title (bug 15233)"...brion04:01, 7 January 2009
r45500Redo simple ?diff check code for setting the right title (bug 15233)aaron13:23, 7 January 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   04:01, 7 January 2009

This code is illegible; it's not very clear what it's doing or why. Please redo with clearer code; comment if necessary.

Reverted in r45486

Status & tagging log