If you request LogEventList to display the combination of 2 log types, and one of
[lhc/web/wiklou.git] / includes / Wiki.php
index 8b62139..4984b5f 100644 (file)
@@ -146,6 +146,9 @@ class MediaWiki {
                        $output->setPrintable();
                }
 
+               $unused = null; // To pass it by reference
+               wfRunHooks( 'BeforeInitialize', array( &$title, &$unused, &$output, &$user, $request, $this ) );
+
                // Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty.
                if ( is_null( $title ) || ( $title->getDBkey() == '' && $title->getInterwiki() == '' ) ||
                        $title->isSpecial( 'Badtitle' ) )
@@ -267,8 +270,6 @@ class MediaWiki {
                                wfProfileOut( __METHOD__ );
                                throw new MWException( "Shouldn't happen: MediaWiki::initializeArticle() returned neither an object nor a URL" );
                        }
-                       wfRunHooks( 'BeforeInitialize',
-                               array( &$title, &$article, &$output, &$user, $request, $this ) );
                }
 
                if ( $pageView ) {
@@ -582,7 +583,6 @@ class MediaWiki {
                # Set title from request parameters
                $wgTitle = $this->getTitle();
                $action = $this->getAction();
-               $user = $this->context->getUser();
 
                # Send Ajax requests to the Ajax dispatcher.
                if ( $wgUseAjax && $action == 'ajax' ) {
@@ -604,8 +604,8 @@ class MediaWiki {
                                                $cache->loadFromFileCache( $this->context );
                                        }
                                        # Do any stats increment/watchlist stuff
-                                       $article = WikiPage::factory( $this->getTitle() );
-                                       $article->doViewUpdates( $user );
+                                       $page = WikiPage::factory( $this->getTitle() );
+                                       $page->doViewUpdates( $this->context->getUser() );
                                        # Tell OutputPage that output is taken care of
                                        $this->context->getOutput()->disable();
                                        wfProfileOut( 'main-try-filecache' );