r45486 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45485‎ | r45486 | r45487 >
Date:04:01, 7 January 2009
Author:brion
Status:ok
Tags:
Comment:
Pull back r45458 "Fix diff= urls with no title (bug 15233)"
This code is illegible; it's not very clear what it's doing or why. Please redo with clearer code; comment if necessary.
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -115,12 +115,11 @@
116116 if( count( $wgContLang->getVariants() ) > 1 && !is_null( $ret ) && $ret->getArticleID() == 0 )
117117 $wgContLang->findVariantLink( $title, $ret );
118118 }
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 ) ) ) {
 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 ) {
125124 $ret = $rev->getTitle();
126125 }
127126 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r45500Redo simple ?diff check code for setting the right title (bug 15233)aaron13:23, 7 January 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45458Fix diff= urls with no title (bug 15233)aaron20:54, 6 January 2009

Status & tagging log