From 04bcd89277182e6e38aa95a02e0b5463a44d92ca Mon Sep 17 00:00:00 2001 From: Moriyoshi Koizumi Date: Thu, 2 Oct 2003 19:07:59 +0000 Subject: [PATCH] Add support for hexadecimal-style numeric entities (&#x..;) --- ext/standard/html.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) { -- 2.50.1