From 34e1fe9e2a905816aa5f977d459a32de7d05e7b4 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 23 Dec 2008 22:48:44 +0000 Subject: [PATCH] Skip redirect checks for NS_MEDIAWIKI --- includes/Wiki.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index 9feeb0839d..00fd407532 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -42,6 +42,7 @@ class MediaWiki { /** * Initialization of ... everything * Performs the request too + * FIXME: why is this crap called "initialize" when it performs everything? * * @param $title Title ($wgTitle) * @param $article Article @@ -85,7 +86,6 @@ class MediaWiki { } } - /** * Checks some initial queries * Note that $title here is *not* a Title object, but a string! @@ -157,6 +157,8 @@ class MediaWiki { * - redirect loop * - special pages * + * FIXME: why is this crap called "initialize" when it performs everything? + * * @param $title Title * @param $output OutputPage * @param $request WebRequest @@ -286,9 +288,14 @@ class MediaWiki { function initializeArticle( &$title, $request ) { wfProfileIn( __METHOD__ ); - $action = $this->getVal( 'action' ); + $action = $this->getVal( 'action', 'view' ); $article = self::articleFromTitle( $title ); - + # NS_MEDIAWIKI has no redirects. + # It is also used for CSS/JS, so performance matters here... + if( $title->getNamespace() == NS_MEDIAWIKI ) { + wfProfileOut( __METHOD__ ); + return $article; + } // Namespace might change when using redirects // Check for redirects ... $file = ($title->getNamespace() == NS_FILE) ? $article->getFile() : null; @@ -317,8 +324,7 @@ class MediaWiki { return $target; } } - - if( is_object( $target ) ) { + if( is_object($target) ) { // Rewrite environment to redirected article $rarticle = self::articleFromTitle( $target ); $rarticle->loadPageData( $rarticle->pageDataFromTitle( $dbr, $target ) ); -- 2.20.1