From b697307bac125959cf8dbd3409018c70c6fe0db4 Mon Sep 17 00:00:00 2001 From: fappels Date: Sun, 22 Jul 2018 10:41:39 +0200 Subject: [PATCH] Fix chromephp firephp Syslog infinite loop. When chromephp/firephp not found ->trans causes infinite loop. Can happen when files moved to other server or location. --- htdocs/core/modules/syslog/mod_syslog_chromephp.php | 5 +++-- htdocs/core/modules/syslog/mod_syslog_firephp.php | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/syslog/mod_syslog_chromephp.php b/htdocs/core/modules/syslog/mod_syslog_chromephp.php index a9b9ccd5836de..7523588ac1519 100644 --- a/htdocs/core/modules/syslog/mod_syslog_chromephp.php +++ b/htdocs/core/modules/syslog/mod_syslog_chromephp.php @@ -121,13 +121,14 @@ public function checkConfiguration() if (! file_exists($conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH.'/ChromePhp.php') && ! file_exists($conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH.'/ChromePhp.class.php')) { + $conf->global->MAIN_SYSLOG_DISABLE_CHROMEPHP = 1; // avoid infinite loop if (is_object($langs)) // $langs may not be defined yet. { - $errors[] = $langs->trans("ErrorFailedToOpenFile", 'ChromePhp.class.php or ChromePhp.php'); + $errors[] = $langs->trans("ErrorFailedToOpenFile", 'ChromePhp.class.php or ChromePhp.php'); } else { - $errors[] = "ErrorFailedToOpenFile ChromePhp.class.php or ChromePhp.php"; + $errors[] = "ErrorFailedToOpenFile ChromePhp.class.php or ChromePhp.php"; } } diff --git a/htdocs/core/modules/syslog/mod_syslog_firephp.php b/htdocs/core/modules/syslog/mod_syslog_firephp.php index 69bc98230af78..f502022c4f61e 100644 --- a/htdocs/core/modules/syslog/mod_syslog_firephp.php +++ b/htdocs/core/modules/syslog/mod_syslog_firephp.php @@ -122,7 +122,15 @@ public function checkConfiguration() if (!file_exists($conf->global->SYSLOG_FIREPHP_INCLUDEPATH . self::$firephp_class_path)) { - $errors[] = $langs->trans("ErrorFailedToOpenFile", self::$firephp_class_path); + $conf->global->MAIN_SYSLOG_DISABLE_FIREPHP = 1; // avoid infinite loop + if (is_object($langs)) // $langs may not be defined yet. + { + $errors[] = $langs->trans("ErrorFailedToOpenFile", self::$firephp_class_path); + } + else + { + $errors[] = "ErrorFailedToOpenFile " . self::$firephp_class_path; + } } return $errors;