From: Alex Dowad Date: Sat, 19 Sep 2020 18:41:01 +0000 (+0200) Subject: Add identify filter for ISO-8859-8 (Latin/Hebrew) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c6b2a7ad241a78b61b1077462cd01b1ffcff92a;p=php Add identify filter for ISO-8859-8 (Latin/Hebrew) --- diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c index 6e4a7f322b..36c967405b 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c @@ -31,6 +31,8 @@ #include "mbfilter_iso8859_8.h" #include "unicode_table_iso8859_8.h" +static int mbfl_filt_ident_iso8859_8(int c, mbfl_identify_filter *filter); + static const char *mbfl_encoding_8859_8_aliases[] = {"ISO8859-8", "hebrew", NULL}; const mbfl_encoding mbfl_encoding_8859_8 = { @@ -47,7 +49,7 @@ const mbfl_encoding mbfl_encoding_8859_8 = { const struct mbfl_identify_vtbl vtbl_identify_8859_8 = { mbfl_no_encoding_8859_8, mbfl_filt_ident_common_ctor, - mbfl_filt_ident_true + mbfl_filt_ident_iso8859_8 }; const struct mbfl_convert_vtbl vtbl_8859_8_wchar = { @@ -131,3 +133,11 @@ int mbfl_filt_conv_wchar_8859_8(int c, mbfl_convert_filter *filter) return c; } + +static int mbfl_filt_ident_iso8859_8(int c, mbfl_identify_filter *filter) +{ + if (c >= 0xA0 && !iso8859_8_ucs_table[c - 0xA0]) { + filter->status = 1; + } + return c; +}