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
*/
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;