Fix error management

This commit is contained in:
Laurent Destailleur 2023-11-29 23:07:29 +01:00
parent d809825c21
commit b3c4697c7d
2 changed files with 4 additions and 4 deletions

View file

@ -244,7 +244,7 @@ class Mailing extends CommonObject
global $conf, $langs;
// Check properties
if ($this->body === 'InvalidHTMLStringCantBeCleaned') {
if (preg_match('/^InvalidHTMLStringCantBeCleaned/', $this->body)) {
$this->error = 'InvalidHTMLStringCantBeCleaned';
return -1;
}
@ -313,7 +313,7 @@ class Mailing extends CommonObject
public function update($user, $notrigger = 0)
{
// Check properties
if ($this->body === 'InvalidHTMLStringCantBeCleaned') {
if (preg_match('/^InvalidHTMLStringCantBeCleaned/', $this->body)) {
$this->error = 'InvalidHTMLStringCantBeCleaned';
return -1;
}

View file

@ -7604,7 +7604,7 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = '
} catch (Exception $e) {
// If error, invalid HTML string with no way to clean it
//print $e->getMessage();
$out = 'InvalidHTMLStringCantBeCleaned';
$out = 'InvalidHTMLStringCantBeCleaned '.$e->getMessage();
}
}
@ -7640,7 +7640,7 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = '
} catch (Exception $e) {
// If error, invalid HTML string with no way to clean it
//print $e->getMessage();
$out = 'InvalidHTMLStringCantBeCleaned';
$out = 'InvalidHTMLStringCantBeCleaned '.$e->getMessage();
}
}