summaryrefslogtreecommitdiff
path: root/includes/Wiki.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/Wiki.php')
-rw-r--r--includes/Wiki.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/includes/Wiki.php b/includes/Wiki.php
index ce4ce67e..38f19c96 100644
--- a/includes/Wiki.php
+++ b/includes/Wiki.php
@@ -115,12 +115,15 @@ 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 ) {
- $ret = $rev->getTitle();
+ # For non-special titles, check for implicit titles
+ if( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) {
+ // We can have urls with just ?diff=,?oldid= or even just ?diff=
+ $oldid = $wgRequest->getInt( 'oldid' );
+ $oldid = $oldid ? $oldid : $wgRequest->getInt( 'diff' );
+ // Allow oldid to override a changed or missing title
+ if( $oldid ) {
+ $rev = Revision::newFromId( $oldid );
+ $ret = $rev ? $rev->getTitle() : $ret;
}
}
return $ret;
@@ -447,8 +450,10 @@ class MediaWiki {
$article->view();
break;
case 'raw': // includes JS/CSS
+ wfProfileIn( __METHOD__.'-raw' );
$raw = new RawPage( $article );
$raw->view();
+ wfProfileOut( __METHOD__.'-raw' );
break;
case 'watch':
case 'unwatch':