Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -115,12 +115,15 @@ |
116 | 116 | if( count( $wgContLang->getVariants() ) > 1 && !is_null( $ret ) && $ret->getArticleID() == 0 ) |
117 | 117 | $wgContLang->findVariantLink( $title, $ret ); |
118 | 118 | } |
119 | | - if( ( $oldid = $wgRequest->getInt( 'oldid' ) ) |
120 | | - && ( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) ) { |
121 | | - // Allow oldid to override a changed or missing title. |
122 | | - $rev = Revision::newFromId( $oldid ); |
123 | | - if( $rev ) { |
124 | | - $ret = $rev->getTitle(); |
| 119 | + # For non-special titles, check for implicit titles |
| 120 | + if( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) { |
| 121 | + // We can have urls with just ?diff=,?oldid= or even just ?diff= |
| 122 | + $oldid = $wgRequest->getInt( 'oldid' ); |
| 123 | + $oldid = $oldid ? $oldid : $wgRequest->getInt( 'diff' ); |
| 124 | + // Allow oldid to override a changed or missing title |
| 125 | + if( $oldid ) { |
| 126 | + $rev = Revision::newFromId( $oldid ); |
| 127 | + $ret = $rev ? $rev->getTitle() : $ret; |
125 | 128 | } |
126 | 129 | } |
127 | 130 | return $ret; |