[ticket/16690] Fix html functions default flag in convertor

PHPBB3-16690
This commit is contained in:
rxu 2021-01-20 23:26:29 +07:00
parent 2fd4dbb685
commit 513e62f61d
No known key found for this signature in database
GPG key ID: 955F0567380E586A

View file

@ -1468,6 +1468,12 @@ class convertor
$value = array($value);
}
// Add ENT_COMPAT default flag to html specialchars/entities functions, see PHPBB3-16690
if (in_array($execution, ['htmlspecialchars', 'htmlentities', 'htmlspecialchars_decode', 'html_entitity_decode']))
{
$value[] = ENT_COMPAT;
}
$value = call_user_func_array($execution, $value);
}
else if (strpos($type, 'execute') === 0)
@ -1517,6 +1523,12 @@ class convertor
$value = array($value);
}
// Add ENT_COMPAT default flag to html specialchars/entities functions, see PHPBB3-16690
if (in_array($execution, ['htmlspecialchars', 'htmlentities', 'htmlspecialchars_decode', 'html_entitity_decode']))
{
$value[] = ENT_COMPAT;
}
$value = call_user_func_array($execution, $value);
}
else if (strpos($type, 'execute') === 0)