Fix: Avoid empty messages

This commit is contained in:
Laurent Destailleur 2012-10-17 19:02:21 +02:00
parent c4ce66d784
commit 319b512157

View File

@ -3494,13 +3494,13 @@ function setEventMessage($mesgs, $style='mesgs')
if (! in_array($style,array('mesgs','warnings','errors'))) dol_print_error('','Bad parameter for setEventMessage'); if (! in_array($style,array('mesgs','warnings','errors'))) dol_print_error('','Bad parameter for setEventMessage');
if (! is_array($mesgs)) // If mesgs is a string if (! is_array($mesgs)) // If mesgs is a string
{ {
$_SESSION['dol_events'][$style][] = $mesgs; if ($mesgs) $_SESSION['dol_events'][$style][] = $mesgs;
} }
else // If mesgs is an array else // If mesgs is an array
{ {
foreach($mesgs as $mesg) foreach($mesgs as $mesg)
{ {
$_SESSION['dol_events'][$style][] = $mesg; if ($mesg) $_SESSION['dol_events'][$style][] = $mesg;
} }
} }
} }