diff options
| -rw-r--r-- | ext/standard/html.c | 6 |
1 files changed, 5 insertions, 1 deletions
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) { |
