From: Aaron Schulz Date: Tue, 6 Jan 2009 20:54:48 +0000 (+0000) Subject: Fix diff= urls with no title (bug 15233) X-Git-Tag: 1.31.0-rc.0~43550 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=b48561197be685f89f3b951801c60a3a553d242c;p=lhc%2Fweb%2Fwiklou.git Fix diff= urls with no title (bug 15233) --- 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(); } }