From 310ef11dac60dd1a2bd2ac600438ef5ac1180d06 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Aug 2023 15:45:45 +0200 Subject: [PATCH] FIX WAF --- htdocs/comm/mailing/class/mailing.class.php | 8 +++--- htdocs/core/class/html.form.class.php | 9 +++--- htdocs/core/lib/functions.lib.php | 23 ++++++++------- htdocs/main.inc.php | 32 ++++++++++----------- htdocs/website/index.php | 4 +-- test/phpunit/SecurityTest.php | 10 +++++-- 6 files changed, 46 insertions(+), 40 deletions(-) diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 4371848c522..b6c542fb4a8 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -237,8 +237,8 @@ class Mailing extends CommonObject global $conf, $langs; // Check properties - if ($this->body === 'InvalidHTMLString') { - $this->error = 'InvalidHTMLString'; + if ($this->body === 'InvalidHTMLStringCantBeCleaned') { + $this->error = 'InvalidHTMLStringCantBeCleaned'; return -1; } @@ -306,8 +306,8 @@ class Mailing extends CommonObject public function update($user, $notrigger = 0) { // Check properties - if ($this->body === 'InvalidHTMLString') { - $this->error = 'InvalidHTMLString'; + if ($this->body === 'InvalidHTMLStringCantBeCleaned') { + $this->error = 'InvalidHTMLStringCantBeCleaned'; return -1; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2b1031cef49..0b45ba263ff 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -247,7 +247,7 @@ class Form $editaction = GETPOST('action', 'aZ09'); } $editmode = ($editaction == 'edit' . $htmlname); - if ($editmode) { + if ($editmode) { // edit mode $ret .= "\n"; $ret .= '
'; $ret .= ''; @@ -281,7 +281,6 @@ class Form $morealt = ' style="width: ' . $cols . '"'; $cols = ''; } - $valuetoshow = ($editvalue ? $editvalue : $value); $ret .= '