]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/filecheck.pm
In VCS-committed anonymous comments, link to url.
[ikiwiki.git] / IkiWiki / Plugin / filecheck.pm
index 4f4e67489a41c51ecae344119362f0ea611d481a..6e65283983b472fe26c86351fb6572ec5ae51865 100644 (file)
@@ -48,7 +48,6 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => undef,
-                       section => "misc",
                },
 }
 
@@ -140,7 +139,7 @@ sub match_mimetype ($$;@) {
        my $mimeinfo_ok=! $@;
        my $mimetype;
        if ($mimeinfo_ok) {
-               my $mimetype=File::MimeInfo::Magic::magic($file);
+               $mimetype=File::MimeInfo::Magic::magic($file);
        }
 
        # Fall back to using file, which has a more complete
@@ -151,7 +150,7 @@ sub match_mimetype ($$;@) {
                chomp $mimetype;
                close $file_h;
        }
-       if (! defined $mimetype || $mimetype !~s /;.*//) {
+       if (! defined $mimetype) {
                # Fall back to default value.
                $mimetype=File::MimeInfo::Magic::default($file)
                        if $mimeinfo_ok;
@@ -159,6 +158,8 @@ sub match_mimetype ($$;@) {
                        $mimetype="unknown";
                }
        }
+       # Ignore any parameters, we only want the type itself
+       $mimetype =~ s/;.*//;
 
        my $regexp=IkiWiki::glob2re($wanted);
        if ($mimetype!~$regexp) {