]> granicus.if.org Git - php/commitdiff
Fixed bug #20934 (htmlspecialchars returns latin1 from UTF-8)
authorMoriyoshi Koizumi <moriyoshi@php.net>
Thu, 12 Dec 2002 13:25:51 +0000 (13:25 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Thu, 12 Dec 2002 13:25:51 +0000 (13:25 +0000)
ext/standard/html.c

index b2d69cbc463664e0656e1ee1fffe49aad3a56648..944cbfc239b6cd9f49b7b0652c7b55560e25be5d 100644 (file)
@@ -801,11 +801,10 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
 
                        }
                        if (!is_basic) {
-                               if (this_char > 0xff) {
-                                       /* a wide char without a named entity; pass through the original sequence */
+                               /* a wide char without a named entity; pass through the original sequence */
+                               if (mbseqlen > 1) {
                                        memcpy(replaced + len, mbsequence, mbseqlen);
                                        len += mbseqlen;
-
                                } else {
                                        replaced[len++] = (unsigned char)this_char;
                                }