r45500 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45499‎ | r45500 | r45501 >
Date:13:23, 7 January 2009
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Redo simple ?diff check code for setting the right title (bug 15233)
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -115,12 +115,15 @@
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 ) {
124 - $ret = $rev->getTitle();
 119+ # For non-special titles, check for implicit titles
 120+ if( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) {
 121+ // We can have urls with just ?diff=,?oldid= or even just ?diff=
 122+ $oldid = $wgRequest->getInt( 'oldid' );
 123+ $oldid = $oldid ? $oldid : $wgRequest->getInt( 'diff' );
 124+ // Allow oldid to override a changed or missing title
 125+ if( $oldid ) {
 126+ $rev = Revision::newFromId( $oldid );
 127+ $ret = $rev ? $rev->getTitle() : $ret;
125128 }
126129 }
127130 return $ret;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45458Fix diff= urls with no title (bug 15233)aaron20:54, 6 January 2009
r45486Pull back r45458 "Fix diff= urls with no title (bug 15233)"...brion04:01, 7 January 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   18:10, 13 January 2009

Looks clearer, thanks! :)

Status & tagging log