diff options
| author | Moriyoshi Koizumi <moriyoshi@php.net> | 2003-10-02 19:07:59 +0000 |
|---|---|---|
| committer | Moriyoshi Koizumi <moriyoshi@php.net> | 2003-10-02 19:07:59 +0000 |
| commit | 04bcd89277182e6e38aa95a02e0b5463a44d92ca (patch) | |
| tree | 4c18318b6a2def2eb03d35d72448f3ab28be1fc7 /ext/standard/html.c | |
| parent | edd18bae09c359687c7d1a1bf0bc2b7faf890b6b (diff) | |
| download | php-git-04bcd89277182e6e38aa95a02e0b5463a44d92ca.tar.gz | |
Add support for hexadecimal-style numeric entities (&#x..;)
Diffstat (limited to 'ext/standard/html.c')
| -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) { |
