From 7f8d791d39517085c2cb2ebef7213ef33752d376 Mon Sep 17 00:00:00 2001 From: Gitdyr Date: Sun, 10 Sep 2017 07:24:38 +0200 Subject: [PATCH] Revert "Remove processing by htmlentities()" This reverts commit e555233dc12c1a206ae41754df78f2086cbba110. --- htdocs/core/class/translate.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 180b4db0ba6..169aec16307 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -620,6 +620,15 @@ class Translate if ($maxsize) $str=dol_trunc($str,$maxsize); + // We replace some HTML tags by __xx__ to avoid having them encoded by htmlentities + $str=str_replace(array('<','>','"',),array('__lt__','__gt__','__quot__'),$str); + + // Crypt string into HTML + $str=htmlentities($str,ENT_QUOTES,$this->charset_output); + + // Restore HTML tags + $str=str_replace(array('__lt__','__gt__','__quot__'),array('<','>','"',),$str); + return $str; } else // Translation is not available