summaryrefslogtreecommitdiff
path: root/ext/standard/html.c
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2002-12-12 13:25:51 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2002-12-12 13:25:51 +0000
commit3bbcb0d0dd6752373c79cea69fd7a552ae640303 (patch)
tree91893269db065a73e0f88a9a92e650ab1de68d78 /ext/standard/html.c
parenta40ccefd322fb704e58919c5624ae4f9f8a1ac75 (diff)
downloadphp-git-3bbcb0d0dd6752373c79cea69fd7a552ae640303.tar.gz
Fixed bug #20934 (htmlspecialchars returns latin1 from UTF-8)
Diffstat (limited to 'ext/standard/html.c')
-rw-r--r--ext/standard/html.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/standard/html.c b/ext/standard/html.c
index b2d69cbc46..944cbfc239 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -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;
}