mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-17 23:11:29 +01:00
Merge pull request #27204 from vmaury/fix_27203_uglymessages
Fix #27203 avoid ugly messages
This commit is contained in:
@@ -9024,7 +9024,8 @@ function setEventMessage($mesgs, $style = 'mesgs', $noduplicate = 0)
|
||||
{
|
||||
//dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); This is not deprecated, it is used by setEventMessages function
|
||||
if (!is_array($mesgs)) {
|
||||
// If mesgs is a string
|
||||
$mesgs = trim((string) $mesgs);
|
||||
// If mesgs is a not an empty string
|
||||
if ($mesgs) {
|
||||
if (!empty($noduplicate) && isset($_SESSION['dol_events'][$style]) && in_array($mesgs, $_SESSION['dol_events'][$style])) {
|
||||
return;
|
||||
@@ -9034,6 +9035,7 @@ function setEventMessage($mesgs, $style = 'mesgs', $noduplicate = 0)
|
||||
} else {
|
||||
// If mesgs is an array
|
||||
foreach ($mesgs as $mesg) {
|
||||
$mesg = trim((string) $mesg);
|
||||
if ($mesg) {
|
||||
if (!empty($noduplicate) && isset($_SESSION['dol_events'][$style]) && in_array($mesg, $_SESSION['dol_events'][$style])) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user