From fd02185e3bef7844a2b108007941703cda6b5c0f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 7 Jan 2009 04:01:05 +0000 Subject: [PATCH] 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. --- includes/Wiki.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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(); } } -- 2.20.1