From a27e347ee0730500b1eb7b05c27ea30be5f5a003 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 28 Jul 2012 22:20:58 +0200 Subject: [PATCH] Fix: for backward compatibility --- htdocs/core/lib/functions.lib.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bce43c8c5d8..e24b5ba4c7f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3463,12 +3463,21 @@ function dol_htmloutput_events($mesgs=array(),$errors=array(),$warnings=array()) if (isset($_SESSION['dol_events'])) { if (is_array($mesgs) && isset($_SESSION['dol_events']['mesgs'])) { + if (! is_array($_SESSION['dol_events']['mesgs'])) { + $_SESSION['dol_events']['mesgs']=array($_SESSION['dol_events']['mesgs']); // For backward compatibility + } $mesgs = array_merge($mesgs, $_SESSION['dol_events']['mesgs']); } if (is_array($errors) && isset($_SESSION['dol_events']['errors'])) { + if (! is_array($_SESSION['dol_events']['errors'])) { + $_SESSION['dol_events']['errors']=array($_SESSION['dol_events']['errors']); // For backward compatibility + } $errors = array_merge($errors, $_SESSION['dol_events']['errors']); } if (is_array($warnings) && isset($_SESSION['dol_events']['warnings'])) { + if (! is_array($_SESSION['dol_events']['warnings'])) { + $_SESSION['dol_events']['warnings']=array($_SESSION['dol_events']['warnings']); // For backward compatibility + } $warnings = array_merge($warnings, $_SESSION['dol_events']['warnings']); }