From b48561197be685f89f3b951801c60a3a553d242c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 6 Jan 2009 20:54:48 +0000 Subject: [PATCH] Fix diff= urls with no title (bug 15233) --- includes/Wiki.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index ce4ce67ec2..a94d3775fe 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -115,11 +115,12 @@ class MediaWiki { if( count( $wgContLang->getVariants() ) > 1 && !is_null( $ret ) && $ret->getArticleID() == 0 ) $wgContLang->findVariantLink( $title, $ret ); } - 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 ) { + 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 ) ) ) { $ret = $rev->getTitle(); } } -- 2.20.1