From: Moriyoshi Koizumi Date: Thu, 2 Oct 2003 19:07:59 +0000 (+0000) Subject: Add support for hexadecimal-style numeric entities (&#x..;) X-Git-Tag: BEFORE_HANDLERS_RESHUFFLE~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04bcd89277182e6e38aa95a02e0b5463a44d92ca;p=php Add support for hexadecimal-style numeric entities (&#x..;) --- diff --git a/ext/standard/html.c b/ext/standard/html.c index 3d4851baae..da93456abc 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -926,7 +926,11 @@ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *new if (p[1] == '#') { int invalid_code = 0; - code = strtol(p + 2, &next, 10); + if (p[2] == 'x' || p[2] == 'X') { + code = strtol(p + 3, &next, 16); + } else { + code = strtol(p + 2, &next, 10); + } if (next != NULL && *next == ';') { switch (charset) {