Skip to content

Commit e210de8

Browse files
committed
handle html entities empty string
1 parent d154c72 commit e210de8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/standard/html.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,10 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
13201320
Z_PARAM_BOOL(double_encode);
13211321
ZEND_PARSE_PARAMETERS_END();
13221322

1323+
if (str->len == 0) {
1324+
RETVAL_STR(str);
1325+
return;
1326+
}
13231327
replaced = php_escape_html_entities_ex(
13241328
(unsigned char*)ZSTR_VAL(str), ZSTR_LEN(str), all, (int) flags,
13251329
hint_charset ? ZSTR_VAL(hint_charset) : NULL, double_encode, /* quiet */ 0);

0 commit comments

Comments
 (0)