Merge "In Installer, set the context language early to avoid loading from User"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 10 Feb 2016 15:22:42 +0000 (15:22 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 10 Feb 2016 15:22:42 +0000 (15:22 +0000)
1  2 
includes/installer/Installer.php

@@@ -361,6 -361,10 +361,10 @@@ abstract class Installer 
        public function __construct() {
                global $wgMessagesDirs, $wgUser;
  
+               // Don't attempt to load user language options (T126177)
+               // This will be overridden in the web installer with the user-specified language
+               RequestContext::getMain()->setLanguage( 'en' );
                // Disable the i18n cache
                Language::getLocalisationCache()->disableBackend();
                // Disable LoadBalancer and wfGetDB etc.
  
                // Having a user with id = 0 safeguards us from DB access via User::loadOptions().
                $wgUser = User::newFromId( 0 );
 +              RequestContext::getMain()->setUser( $wgUser );
  
                $this->settings = $this->internalDefaults;
  
                }
  
                $this->parserTitle = Title::newFromText( 'Installer' );
-               $this->parserOptions = new ParserOptions; // language will be wrong :(
+               $this->parserOptions = new ParserOptions( $wgUser ); // language will be wrong :(
                $this->parserOptions->setEditSection( false );
        }