From a6d20ab648f1282d4298b1480da06244dffeebcd Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Tue, 13 Apr 2021 16:43:26 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03731=20\DeprecatedCallsLog=20:=20always?= =?UTF-8?q?=20catch=20errors=20so=20that=20we=20won't=20crash=20the=20call?= =?UTF-8?q?er?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/log.class.inc.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/core/log.class.inc.php b/core/log.class.inc.php index 12c8da7cc..e05e920e0 100644 --- a/core/log.class.inc.php +++ b/core/log.class.inc.php @@ -862,13 +862,17 @@ class DeprecatedCallsLog extends LogAPI /** * @param string|null $sAdditionalMessage * - * @throws \ConfigException * @link https://www.php.net/debug_backtrace * @uses \debug_backtrace() */ public static function NotifyDeprecatedPhpMethod(?string $sAdditionalMessage = null): void { - if (!static::IsLogLevelEnabled(self::LEVEL_WARNING, self::ENUM_CHANNEL_PHP_METHOD)) { + try { + if (!static::IsLogLevelEnabled(self::LEVEL_WARNING, self::ENUM_CHANNEL_PHP_METHOD)) { + return; + } + } + catch (ConfigException $e) { return; } @@ -899,7 +903,12 @@ class DeprecatedCallsLog extends LogAPI trigger_error($sMessage, E_USER_DEPRECATED); } - parent::Log($sLevel, $sMessage, $sChannel, $aContext); + try { + parent::Log($sLevel, $sMessage, $sChannel, $aContext); + } + catch (ConfigException $e) { + // nothing much we can do... and we don't want to crash the caller ! + } } }