diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d1698f2147e..41e9c12c63d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1645,7 +1645,9 @@ function dolPrintHTML($s, $allowiframe = 0) */ function dolPrintHTMLForAttribute($s) { - return dol_escape_htmltag($s); + // The dol_htmlentitiesbr will convert simple text into html + // The dol_escape_htmltag will escape html chars. + return dol_escape_htmltag(dol_htmlentitiesbr($s), 1, -1); } /** @@ -1669,7 +1671,7 @@ function dolPrintHTMLForTextArea($s, $allowiframe = 0) */ function dolPrintPassword($s) { - return htmlspecialchars($s , ENT_COMPAT, 'UTF-8'); + return htmlspecialchars($s, ENT_COMPAT, 'UTF-8'); } @@ -1682,7 +1684,7 @@ function dolPrintPassword($s) * * @param string $stringtoescape String to escape * @param int $keepb 1=Keep b tags, 0=remove them completely - * @param int $keepn 1=Preserve \r\n strings (otherwise, replace them with escaped value). Set to 1 when escaping for a