-
-
Save nikic/7cab20f7286c2b9437276c4fa43f6fb4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter.c b/ext/mbstring/libmbfl/mbfl/mbfilter.c | |
index 69704489fd..495f54324d 100644 | |
--- a/ext/mbstring/libmbfl/mbfl/mbfilter.c | |
+++ b/ext/mbstring/libmbfl/mbfl/mbfilter.c | |
@@ -93,6 +93,8 @@ | |
#include "filters/mbfilter_singlebyte.h" | |
#include "filters/mbfilter_tl_jisx0201_jisx0208.h" | |
#include "filters/mbfilter_utf8.h" | |
+#include "filters/mbfilter_uuencode.h" | |
+#include "filters/mbfilter_htmlent.h" | |
#include "eaw_table.h" | |
@@ -318,6 +320,13 @@ mbfl_encoding_detector *mbfl_encoding_detector_new(const mbfl_encoding **elist, | |
int filter_list_size = 0; | |
for (int i = 0; i < elistsz; i++) { | |
+ /* Don't detect not-really-encodings. */ | |
+ if (elist[i] == &mbfl_encoding_wchar || elist[i] == &mbfl_encoding_base64 | |
+ || elist[i] == &mbfl_encoding_uuencode || elist[i] == &mbfl_encoding_html_ent | |
+ || elist[i] == &mbfl_encoding_qprint || elist[i] == &mbfl_encoding_8bit) { | |
+ continue; | |
+ } | |
+ | |
mbfl_convert_filter *filter = mbfl_convert_filter_new(elist[i], &mbfl_encoding_wchar, | |
mbfl_estimate_encoding_likelihood, NULL, &identd->filter_data[filter_list_size]); | |
if (filter) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment