forked from Wavyzz/dolibarr
FIX #10984 FIX reposition on "Build backup" button
FIX Fatal error on dol_htmloutput_mesg with corrupted array
This commit is contained in:
@@ -6554,10 +6554,17 @@ function dol_htmloutput_mesg($mesgstring = '', $mesgarray = array(), $style = 'o
|
||||
$newmesgarray=array();
|
||||
foreach($mesgarray as $val)
|
||||
{
|
||||
$tmpmesgstring=preg_replace('/<\/div><div class="(error|warning)">/', '<br>', $val);
|
||||
$tmpmesgstring=preg_replace('/<div class="(error|warning)">/', '', $tmpmesgstring);
|
||||
$tmpmesgstring=preg_replace('/<\/div>/', '', $tmpmesgstring);
|
||||
$newmesgarray[]=$tmpmesgstring;
|
||||
if (is_string($val))
|
||||
{
|
||||
$tmpmesgstring=preg_replace('/<\/div><div class="(error|warning)">/', '<br>', $val);
|
||||
$tmpmesgstring=preg_replace('/<div class="(error|warning)">/', '', $tmpmesgstring);
|
||||
$tmpmesgstring=preg_replace('/<\/div>/', '', $tmpmesgstring);
|
||||
$newmesgarray[]=$tmpmesgstring;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Error call of dol_htmloutput_mesg with an array with a value that is not a string", LOG_WARNING);
|
||||
}
|
||||
}
|
||||
$mesgarray=$newmesgarray;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user