]> granicus.if.org Git - php/commitdiff
Add support for hexadecimal-style numeric entities (&#x..;)
authorMoriyoshi Koizumi <moriyoshi@php.net>
Thu, 2 Oct 2003 19:07:59 +0000 (19:07 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Thu, 2 Oct 2003 19:07:59 +0000 (19:07 +0000)
ext/standard/html.c

index 3d4851baaedc75611cf4a7fcce4df63f1d25fa56..da93456abc066eff3728463eb6c5b502b782e8bf 100644 (file)
@@ -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) {