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.
This commit is contained in:
fappels 2018-07-22 10:41:39 +02:00
parent 28113816b4
commit b697307bac
2 changed files with 12 additions and 3 deletions

View File

@ -121,13 +121,14 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
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";
}
}

View File

@ -122,7 +122,15 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
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;