From: Gilles Dubuc Date: Mon, 19 Nov 2018 10:49:23 +0000 (+0100) Subject: Log error when array_flip fails in MessageCache load X-Git-Tag: 1.34.0-rc.0~3479^2 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=de3fc8f765d9a8e891492615a76cc3223499db89;p=lhc%2Fweb%2Fwiklou.git Log error when array_flip fails in MessageCache load Bug: T208897 Change-Id: If6e7a6a3019abbdc11b6604ec706cc88bfddf128 --- diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 5ada42fb77..b669fcd492 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -270,6 +270,17 @@ class MessageCache { $this->overridable = array_flip( Language::getMessageKeysFor( $code ) ); + // T208897 array_flip can fail and return null + if ( is_null( $this->overridable ) ) { + LoggerFactory::getInstance( 'MessageCache' )->error( + __METHOD__ . ': $this->overridable is null', + [ + 'message_keys' => Language::getMessageKeysFor( $code ), + 'code' => $code + ] + ); + } + # 8 lines of code just to say (once) that message cache is disabled if ( $this->mDisable ) { static $shownDisabled = false;