From: Moriyoshi Koizumi Date: Mon, 16 Feb 2009 01:57:37 +0000 (+0000) Subject: - MFH: Fix bug #47399 (mb_check_encoding() return true for some illegal SJIS X-Git-Tag: RELEASE_1_3_5~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d8c6fecca39743463b1b6c5605a25fc05b549aae;p=php - MFH: Fix bug #47399 (mb_check_encoding() return true for some illegal SJIS charcters) --- diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp932.c b/ext/mbstring/libmbfl/filters/mbfilter_cp932.c index 80f7bfbc6b..8fa254b6ce 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cp932.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cp932.c @@ -167,7 +167,7 @@ mbfl_filt_conv_sjiswin_wchar(int c, mbfl_convert_filter *filter) case 1: /* kanji second char */ filter->status = 0; c1 = filter->cache; - if (c > 0x39 && c < 0xfd && c != 0x7f) { + if (c >= 0x40 && c <= 0xfc && c != 0x7f) { w = 0; SJIS_DECODE(c1, c, s1, s2); s = (s1 - 0x21)*94 + s2 - 0x21; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis.c index f9d7ff671d..83ef565927 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_sjis.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis.c @@ -167,7 +167,7 @@ mbfl_filt_conv_sjis_wchar(int c, mbfl_convert_filter *filter) case 1: /* kanji second char */ filter->status = 0; c1 = filter->cache; - if (c > 0x39 && c < 0xfd && c != 0x7f) { + if (c >= 0x40 && c <= 0xfc && c != 0x7f) { SJIS_DECODE(c1, c, s1, s2); w = (s1 - 0x21)*94 + s2 - 0x21; if (w >= 0 && w < jisx0208_ucs_table_size) {