Merge pull request #22225 from hregis/fix_avoid_warning

FIX avoid warning (php7+)
This commit is contained in:
Laurent Destailleur 2022-09-11 20:50:15 +02:00 committed by GitHub
commit 76ca76fd3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1448,9 +1448,9 @@ function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0, $noescapeta
// escape quotes and backslashes, newlines, etc.
if ($escapeonlyhtmltags) {
$tmp = htmlspecialchars_decode($stringtoescape, ENT_COMPAT);
$tmp = htmlspecialchars_decode((string) $stringtoescape, ENT_COMPAT);
} else {
$tmp = html_entity_decode($stringtoescape, ENT_COMPAT, 'UTF-8');
$tmp = html_entity_decode((string) $stringtoescape, ENT_COMPAT, 'UTF-8');
}
if (!$keepb) {
$tmp = strtr($tmp, array("<b>"=>'', '</b>'=>''));