From: Brion Vibber Date: Wed, 7 Jan 2009 04:01:05 +0000 (+0000) Subject: Pull back r45458 "Fix diff= urls with no title (bug 15233)" X-Git-Tag: 1.31.0-rc.0~43528 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=fd02185e3bef7844a2b108007941703cda6b5c0f;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/Wiki.php b/includes/Wiki.php index a94d3775fe..ce4ce67ec2 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -115,12 +115,11 @@ class MediaWiki { if( count( $wgContLang->getVariants() ) > 1 && !is_null( $ret ) && $ret->getArticleID() == 0 ) $wgContLang->findVariantLink( $title, $ret ); } - if( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) { - $oldid = $wgRequest->getInt( 'oldid' ); - if( !$oldid ) - $oldid = $wgRequest->getInt( 'diff' ); - // Allow oldid to override a changed or missing title - if( $oldid && ( $rev = Revision::newFromId( $oldid ) ) ) { + if( ( $oldid = $wgRequest->getInt( 'oldid' ) ) + && ( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) ) { + // Allow oldid to override a changed or missing title. + $rev = Revision::newFromId( $oldid ); + if( $rev ) { $ret = $rev->getTitle(); } }