From 9134892c71bfea4f5b056e296cf3bbfbc684089d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 18 Sep 2020 13:58:09 +0200 Subject: [PATCH] Fix remove useless code --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 051f8a031ca..4a3bdb9167b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -598,6 +598,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null break; case 'restricthtml': // Recommended for most html textarea $out = dol_string_onlythesehtmltags($out, 0); + // TODO We can also remove all javascripts reference break; case 'custom': if (empty($filter)) return 'BadFourthParameterForGETPOST'; @@ -5536,9 +5537,8 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1, "html", "head", "meta", "body", "article", "a", "abbr", "b", "blockquote", "br", "cite", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link", "ol", "p", "q", "s", "section", "span", "strike", "strong", "title", "table", "tr", "th", "td", "u", "ul", "sup", "sub", "blockquote", "pre", "h1", "h2", "h3", "h4", "h5", "h6" ); + $allowed_tags_string = join("><", $allowed_tags); - $allowed_tags_string = preg_replace('/^>/', '', $allowed_tags_string); - $allowed_tags_string = preg_replace('/<$/', '', $allowed_tags_string); $allowed_tags_string = '<'.$allowed_tags_string.'>'; if ($cleanalsosomestyles) {