From 421b69294255b6c400878d7e4a2794b37bbf52d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Oct 2021 21:48:25 +0200 Subject: [PATCH] Clean last br for wysiwyg --- htdocs/core/lib/functions.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 235b76aa885..b08d8e55686 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6638,7 +6638,8 @@ function dol_htmlentitiesbr_decode($stringtodecode, $pagecodeto = 'UTF-8') */ function dol_htmlcleanlastbr($stringtodecode) { - $ret = preg_replace('/(
||'."\n".'|'."\r".')+$/i', "", $stringtodecode); + $ret = preg_replace('/ $/i', "", $stringtodecode); // Because wysiwyg editor may add a   at end of last line + $ret = preg_replace('/(
||'."\n".'|'."\r".')+$/i', "", $ret); return $ret; }