diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 120191f8a51..43956f87b1a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2196,9 +2196,9 @@ function dolPrintText($s) * To output a text inside an attribute, you can use dolPrintHTMLForAttribute() or dolPrintHTMLForTextArea() inside a textarea * With dolPrintHTML(), only content not already in HTML is encoded with HTML. * - * @param string $s String to print - * @param int $allowiframe Allow iframe tags - * @return string String ready for HTML output (sanitized and escape) + * @param int|float|string $s String to print + * @param int $allowiframe Allow iframe tags + * @return string String ready for HTML output (sanitized and escape) * @see dolPrintHTMLForAttribute(), dolPrintHTMLFortextArea(), dolPrintText() */ function dolPrintHTML($s, $allowiframe = 0) @@ -2208,7 +2208,7 @@ function dolPrintHTML($s, $allowiframe = 0) // dol_htmlentitiesbr encode all chars except "'" if string is not already HTML, but // encode only special char like é but not &, <, >, ", ' if already HTML. - $stringWithEntitesForSpecialChar = dol_htmlentitiesbr($s); + $stringWithEntitesForSpecialChar = dol_htmlentitiesbr((string) $s); return dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags($stringWithEntitesForSpecialChar, 1, 1, 1, $allowiframe)), 1, 1, 'common', 0, 1); }