Skip to content

Commit

Permalink
Fix chromephp firephp Syslog infinite loop.
Browse files Browse the repository at this point in the history
When chromephp/firephp not found ->trans causes infinite loop. Can
happen when files moved to other server or location.
  • Loading branch information
fappels committed Jul 22, 2018
1 parent 2811381 commit b697307
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions htdocs/core/modules/syslog/mod_syslog_chromephp.php
Expand Up @@ -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";
}
}

Expand Down
10 changes: 9 additions & 1 deletion htdocs/core/modules/syslog/mod_syslog_firephp.php
Expand Up @@ -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;
Expand Down

0 comments on commit b697307

Please sign in to comment.