From 1a5342e46802f99d7064b84038e1023919aec13c Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 6 Mar 2004 18:35:53 +0000 Subject: [PATCH] MFH: Fixed bug #27505 (htmlentities() does not handle BIG5 correctly). --- NEWS | 2 ++ ext/standard/html.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index ccb58a6af8..74078c7e78 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP 4 NEWS ?? Feb 2004, Version 4.3.5 - Fixed possible crashes inside socket extension, due to missing check inside allocation functions. (Ilia) +- Fixed bug #27505 (htmlentities() does not handle BIG5 correctly). (Ilia, + ywliu at hotmail dot com) - Fixed bug #27443 (defined() returns wrong type). (Derick) - Fixed bug #27437 (wrong freetype include inside GD library). (Ilia) - Fixed bug #27384 (unpack() misbehaves with 1 char string). (GeorgeS) diff --git a/ext/standard/html.c b/ext/standard/html.c index e0f5f8abc4..66e408cb91 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -544,10 +544,10 @@ inline static unsigned short get_next_char(enum entity_charset charset, case cs_big5hkscs: { /* check if this is the first of a 2-byte sequence */ - if (this_char >= 0xa1 && this_char <= 0xf9) { + if (this_char >= 0xa1 && this_char <= 0xfe) { /* peek at the next char */ unsigned char next_char = str[pos]; - if ((next_char >= 0x40 && next_char <= 0x73) || + if ((next_char >= 0x40 && next_char <= 0x7e) || (next_char >= 0xa1 && next_char <= 0xfe)) { /* yes, this a wide char */ this_char <<= 8; -- 2.50.1