mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-10 11:31:26 +01:00
Auto detect if it's error message or not
This commit is contained in:
@@ -3814,7 +3814,14 @@ function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb
|
||||
if (empty($mesgstring) && (! is_array($mesgarray) || sizeof($mesgarray) == 0)) return;
|
||||
|
||||
$iserror=0;
|
||||
if (preg_match('/class="error"/i',$mesgstring)) $iserror++;
|
||||
if (is_array($mesg_array))
|
||||
{
|
||||
foreach($mesg_array as $val)
|
||||
{
|
||||
if ($val && preg_match('/class="error"/i',$val)) { $iserror++; break; }
|
||||
}
|
||||
}
|
||||
else if ($mesgstring && preg_match('/class="error"/i',$mesgstring)) $iserror++;
|
||||
if ($style=='error') $iserror++;
|
||||
|
||||
if ($iserror) print get_htmloutput_mesg($mesgstring,$mesgarray,'error',$keepembedded);
|
||||
|
||||
Reference in New Issue
Block a user