Fix diff= urls with no title (bug 15233)
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 6 Jan 2009 20:54:48 +0000 (20:54 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 6 Jan 2009 20:54:48 +0000 (20:54 +0000)
includes/Wiki.php

index ce4ce67..a94d377 100644 (file)
@@ -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();
                        }
                }