"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "includes/context/RequestContext.php" between
mediawiki-1.31.1.tar.gz and mediawiki-1.32.0.tar.gz

About: MediaWiki is a wiki engine (the collaborative editing software that runs for e.g. Wikipedia, the free encyclopedia).

RequestContext.php  (mediawiki-1.31.1):RequestContext.php  (mediawiki-1.32.0)
skipping to change at line 328 skipping to change at line 328
if ( isset( $this->recursion ) ) { if ( isset( $this->recursion ) ) {
trigger_error( "Recursion detected in " . __METHOD__, E_U SER_WARNING ); trigger_error( "Recursion detected in " . __METHOD__, E_U SER_WARNING );
$e = new Exception; $e = new Exception;
wfDebugLog( 'recursion-guard', "Recursion detected:\n" . $e->getTraceAsString() ); wfDebugLog( 'recursion-guard', "Recursion detected:\n" . $e->getTraceAsString() );
$code = $this->getConfig()->get( 'LanguageCode' ) ?: 'en' ; $code = $this->getConfig()->get( 'LanguageCode' ) ?: 'en' ;
$this->lang = Language::factory( $code ); $this->lang = Language::factory( $code );
} elseif ( $this->lang === null ) { } elseif ( $this->lang === null ) {
$this->recursion = true; $this->recursion = true;
global $wgContLang;
try { try {
$request = $this->getRequest(); $request = $this->getRequest();
$user = $this->getUser(); $user = $this->getUser();
$code = $request->getVal( 'uselang', 'user' ); $code = $request->getVal( 'uselang', 'user' );
if ( $code === 'user' ) { if ( $code === 'user' ) {
$code = $user->getOption( 'language' ); $code = $user->getOption( 'language' );
} }
$code = self::sanitizeLangCode( $code ); $code = self::sanitizeLangCode( $code );
Hooks::run( 'UserGetLanguageObject', [ $user, &$c ode, $this ] ); Hooks::run( 'UserGetLanguageObject', [ $user, &$c ode, $this ] );
if ( $code === $this->getConfig()->get( 'Language Code' ) ) { if ( $code === $this->getConfig()->get( 'Language Code' ) ) {
$this->lang = $wgContLang; $this->lang = MediaWikiServices::getInsta nce()->getContentLanguage();
} else { } else {
$obj = Language::factory( $code ); $obj = Language::factory( $code );
$this->lang = $obj; $this->lang = $obj;
} }
unset( $this->recursion ); unset( $this->recursion );
} }
catch ( Exception $ex ) { catch ( Exception $ex ) {
unset( $this->recursion ); unset( $this->recursion );
throw $ex; throw $ex;
skipping to change at line 426 skipping to change at line 424
* Parameters are the same as wfMessage() * Parameters are the same as wfMessage()
* *
* @param string|string[]|MessageSpecifier $key Message key, or array of keys, * @param string|string[]|MessageSpecifier $key Message key, or array of keys,
* or a MessageSpecifier. * or a MessageSpecifier.
* @param mixed $args,... * @param mixed $args,...
* @return Message * @return Message
*/ */
public function msg( $key ) { public function msg( $key ) {
$args = func_get_args(); $args = func_get_args();
return call_user_func_array( 'wfMessage', $args )->setContext( $t his ); return wfMessage( ...$args )->setContext( $this );
} }
/** /**
* Get the RequestContext object associated with the main request * Get the RequestContext object associated with the main request
* *
* @return RequestContext * @return RequestContext
*/ */
public static function getMain() { public static function getMain() {
if ( self::$instance === null ) { if ( self::$instance === null ) {
self::$instance = new self; self::$instance = new self;
 End of changes. 3 change blocks. 
4 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)