From: Tim Starling Date: Fri, 8 Feb 2013 05:38:41 +0000 (+1100) Subject: Weaken the recursion guard on RequestContext::getLanguage() X-Git-Tag: 1.31.0-rc.0~20758^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=4d15d532598134bdc659ab4cee469d2f2025fecd;p=lhc%2Fweb%2Fwiklou.git Weaken the recursion guard on RequestContext::getLanguage() Just log and soldier on, since for some reason we are seeing a lot of these exceptions at the moment, with multiple root causes. Based on Matt Walker's I49dbc2d7. Updates Idc11b547. See bug 44754. Change-Id: I2e8c062741c1b2ec2acd68dc76d3fb6efb113571 --- diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index 96d27b001f..09cb409f65 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -278,10 +278,14 @@ class RequestContext implements IContextSource { */ public function getLanguage() { if ( isset( $this->recursion ) ) { - throw new MWException( 'Recursion detected' ); - } - - if ( $this->lang === null ) { + trigger_error( "Recursion detected in " . __METHOD__, E_USER_WARNING ); + $e = new Exception; + wfDebugLog( 'recursion-guard', "Recursion detected:\n" . $e->getTraceAsString() ); + + global $wgLanguageCode; + $code = ( $wgLanguageCode ) ? $wgLanguageCode : 'en'; + $this->lang = Language::factory( $code ); + } elseif ( $this->lang === null ) { $this->recursion = true; global $wgLanguageCode, $wgContLang;