+ $ns = $wgTitle->getNamespace();
+
+ // Namespace might change when using redirects
+ if($action == 'view' && !$wgRequest->getVal( 'oldid' ) ) {
+ $wgArticle = new Article( $wgTitle );
+ $rTitle = Title::newFromRedirect( $wgArticle->fetchContent() );
+ if($rTitle) {
+ # Reload from the page pointed to later
+ $wgArticle->mContentLoaded = false;
+ $ns = $rTitle->getNamespace();
+ }
+ }
+
+ // Categories and images are handled by a different class
+ if ( $ns == NS_IMAGE ) {
+ unset($wgArticle);