/**
* 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
}
}
-
/**
* Checks some initial queries
* Note that $title here is *not* a Title object, but a string!
* - redirect loop
* - special pages
*
+ * FIXME: why is this crap called "initialize" when it performs everything?
+ *
* @param $title Title
* @param $output OutputPage
* @param $request WebRequest
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;
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 ) );