mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/standard: handle html entities empty string before processing (#19220)
This commit is contained in:
@@ -1356,6 +1356,9 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
|
||||
Z_PARAM_BOOL(double_encode);
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
if (ZSTR_LEN(str) == 0) {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
replaced = php_escape_html_entities_ex(
|
||||
(unsigned char*)ZSTR_VAL(str), ZSTR_LEN(str), all, (int) flags,
|
||||
hint_charset ? ZSTR_VAL(hint_charset) : NULL, double_encode, /* quiet */ 0);
|
||||
|
||||
Reference in New Issue
Block a user