From 3ce495c2c3b5610a7db18b9aac16b3252fa8c73d Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 7 Aug 2020 16:11:32 +0200 Subject: [PATCH] LSerror: format error message at adding time Format error message at adding time to make sure to be able to format it, even if the component triggered it is not loaded. --- src/includes/class/class.LSerror.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/includes/class/class.LSerror.php b/src/includes/class/class.LSerror.php index 64ee448e..4bb31b49 100644 --- a/src/includes/class/class.LSerror.php +++ b/src/includes/class/class.LSerror.php @@ -69,7 +69,7 @@ class LSerror { * @retval void */ public static function addErrorCode($code=null, $msg=null, $escape=true) { - $_SESSION['LSerror'][] = array($code, $msg, $escape); + $_SESSION['LSerror'][] = self :: formatError($code, $msg, $escape); if (class_exists('LSlog')) LSlog :: error(self :: formatError($code, $msg, $escape, 'addslashes')); } @@ -127,7 +127,7 @@ class LSerror { if(!empty($_SESSION['LSerror'])) { $txt = ''; foreach ($_SESSION['LSerror'] as $error) - $txt .= call_user_func_array(array('LSerror', 'formatError'), $error)."
\n"; + $txt .= $error."
\n"; self :: resetError(); return $txt; }