Skip to content

Commit 5947fed

Browse files
authored
ext/standard: handle html entities empty string before processing (#19220)
1 parent ff810d5 commit 5947fed

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/standard/html.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,6 +1356,9 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
13561356
Z_PARAM_BOOL(double_encode);
13571357
ZEND_PARSE_PARAMETERS_END();
13581358

1359+
if (ZSTR_LEN(str) == 0) {
1360+
RETURN_EMPTY_STRING();
1361+
}
13591362
replaced = php_escape_html_entities_ex(
13601363
(unsigned char*)ZSTR_VAL(str), ZSTR_LEN(str), all, (int) flags,
13611364
hint_charset ? ZSTR_VAL(hint_charset) : NULL, double_encode, /* quiet */ 0);

0 commit comments

Comments
 (0)