From b3c4697c7da00d296c2fe8dd8e8af665d1939e93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Nov 2023 23:07:29 +0100 Subject: [PATCH] Fix error management --- htdocs/comm/mailing/class/mailing.class.php | 4 ++-- htdocs/core/lib/functions.lib.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 84132f05218..70824302bb4 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -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; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d4bef79259e..c3cd667aef6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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(); } }