filecheck: Fall back to testing for binary or plain text files if no mime type is...
[ikiwiki.git] / IkiWiki / Plugin / filecheck.pm
index 9c7a8dbb7e79a2ac5865219ec02eb6dabe37a74d..27f764e3b344a344ef2d491552824c2c40e6e5f1 100644 (file)
@@ -127,7 +127,10 @@ sub match_mimetype ($$;@) { #{{{
        }
        my $mimetype=File::MimeInfo::Magic::magic($file);
        if (! defined $mimetype) {
-               $mimetype="unknown";
+               $mimetype=File::MimeInfo::Magic::default($file);
+               if (! defined $mimetype) {
+                       $mimetype="unknown";
+               }
        }
 
        my $regexp=IkiWiki::glob2re($wanted);