Merge "Remove meaningless default action name"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 25 Dec 2014 05:53:44 +0000 (05:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 25 Dec 2014 05:53:44 +0000 (05:53 +0000)
1  2 
includes/MediaWiki.php

diff --combined includes/MediaWiki.php
@@@ -59,7 -59,7 +59,7 @@@ class MediaWiki 
                $request = $this->context->getRequest();
                $curid = $request->getInt( 'curid' );
                $title = $request->getVal( 'title' );
-               $action = $request->getVal( 'action', 'view' );
+               $action = $request->getVal( 'action' );
  
                if ( $request->getCheck( 'search' ) ) {
                        // Compatibility with old search URLs which didn't use Special:Search
                }
  
                $unused = null; // To pass it by reference
 -              wfRunHooks( 'BeforeInitialize', array( &$title, &$unused, &$output, &$user, $request, $this ) );
 +              Hooks::run( '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->isExternal() )
                        && ( $request->getVal( 'title' ) === null
                                || $title->getPrefixedDBkey() != $request->getVal( 'title' ) )
                        && !count( $request->getValueNames( array( 'action', 'title' ) ) )
 -                      && wfRunHooks( 'TestCanonicalRedirect', array( $request, $title, $output ) )
 +                      && Hooks::run( 'TestCanonicalRedirect', array( $request, $title, $output ) )
                ) {
                        if ( $title->isSpecialPage() ) {
                                list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
                        // Give extensions a change to ignore/handle redirects as needed
                        $ignoreRedirect = $target = false;
  
 -                      wfRunHooks( 'InitializeArticleMaybeRedirect',
 +                      Hooks::run( 'InitializeArticleMaybeRedirect',
                                array( &$title, &$request, &$ignoreRedirect, &$target, &$article ) );
  
                        // Follow redirects only for... redirects.
                $title = $this->context->getTitle();
                $user = $this->context->getUser();
  
 -              if ( !wfRunHooks( 'MediaWikiPerformAction',
 +              if ( !Hooks::run( 'MediaWikiPerformAction',
                                array( $output, $page, $title, $user, $request, $this ) )
                ) {
                        wfProfileOut( __METHOD__ );
                        return;
                }
  
 -              if ( wfRunHooks( 'UnknownAction', array( $request->getVal( 'action', 'view' ), $page ) ) ) {
 +              if ( Hooks::run( 'UnknownAction', array( $request->getVal( 'action', 'view' ), $page ) ) ) {
                        $output->setStatusCode( 404 );
                        $output->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
                }
                        $this->triggerJobs();
                        $this->restInPeace();
                } catch ( Exception $e ) {
 -                      MWExceptionHandler::handle( $e );
 +                      MWExceptionHandler::handleException( $e );
                }
        }
  
                $request = $this->context->getRequest();
  
                // Send Ajax requests to the Ajax dispatcher.
-               if ( $this->config->get( 'UseAjax' ) && $request->getVal( 'action', 'view' ) == 'ajax' ) {
+               if ( $this->config->get( 'UseAjax' ) && $request->getVal( 'action' ) === 'ajax' ) {
                        // Set a dummy title, because $wgTitle == null might break things
                        $title = Title::makeTitle( NS_MAIN, 'AJAX' );
                        $this->context->setTitle( $title );
                        $redirUrl = preg_replace( '#^http://#', 'https://', $oldUrl );
  
                        // ATTENTION: This hook is likely to be removed soon due to overall design of the system.
 -                      if ( wfRunHooks( 'BeforeHttpsRedirect', array( $this->context, &$redirUrl ) ) ) {
 +                      if ( Hooks::run( 'BeforeHttpsRedirect', array( $this->context, &$redirUrl ) ) ) {
  
                                if ( $request->wasPosted() ) {
                                        // This is weird and we'd hope it almost never happens. This