Pull back r45458 "Fix diff= urls with no title (bug 15233)"
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 7 Jan 2009 04:01:05 +0000 (04:01 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 7 Jan 2009 04:01:05 +0000 (04:01 +0000)
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

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