From 087b7e3065424111ebb61fab1d4026f2f16c30e1 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 26 May 2023 09:40:28 +0200 Subject: [PATCH] LSerror::getErrors(): add $reset parameter --- src/includes/class/class.LSerror.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/includes/class/class.LSerror.php b/src/includes/class/class.LSerror.php index b6064918..04b458d7 100644 --- a/src/includes/class/class.LSerror.php +++ b/src/includes/class/class.LSerror.php @@ -100,17 +100,20 @@ class LSerror { /** * Format current errors message * + * @param bool $reset Reset errors (optional, default: true) + * * @author Benjamin Renard * * @return array Array of formated error messages */ - public static function getErrors() { + public static function getErrors($reset=true) { $return = ( self :: errorsDefined()? $_SESSION['LSerror']: array() ); - self :: resetError(); + if ($reset) + self :: resetError(); return $return; }