]> granicus.if.org Git - php/commitdiff
fixed #35711 ISO-8859 charset not correctly detected.
authorRui Hirokawa <hirokawa@php.net>
Sat, 24 Dec 2005 01:20:26 +0000 (01:20 +0000)
committerRui Hirokawa <hirokawa@php.net>
Sat, 24 Dec 2005 01:20:26 +0000 (01:20 +0000)
ext/mbstring/libmbfl/mbfl/mbfilter.c

index 0e7072fda72e7fbd6a60ee080ee6e06fa7485729..dba051607939be981fd660becf4a3dde4ac1c7dd 100644 (file)
@@ -576,11 +576,26 @@ mbfl_identify_encoding(mbfl_string *string, enum mbfl_no_encoding *elist, int el
        for (i = 0; i < num; i++) {
                filter = &flist[i];
                if (!filter->flag) {
+                       if (strict && filter->status) {
+                               continue;
+                       }
                        encoding = filter->encoding;
                        break;
                }
        }
 
+       /* fall-back judge */
+       if (!encoding) {
+               for (i = 0; i < num; i++) {
+                       filter = &flist[i];
+                       if (!filter->flag) {
+                               encoding = filter->encoding;
+                               break;
+                       }
+               }
+       }
+
+
        /* cleanup */
        /* dtors should be called in reverse order */
        i = num; while (--i >= 0) {