X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/f398ad035b973608d380c9939ea845d8e2a0cdc2..8fb42f42f495095ca32a569401df21f089f0e40c:/IkiWiki/Plugin/filecheck.pm diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm index a78058ffe..9992f2c26 100644 --- a/IkiWiki/Plugin/filecheck.pm +++ b/IkiWiki/Plugin/filecheck.pm @@ -48,7 +48,6 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, - section => "misc", }, } @@ -148,6 +147,7 @@ sub match_mimetype ($$;@) { if (! defined $mimetype) { open(my $file_h, "-|", "file", "-bi", $file); $mimetype=<$file_h>; + chomp $mimetype; close $file_h; } if (! defined $mimetype || $mimetype !~s /;.*//) { @@ -160,7 +160,7 @@ sub match_mimetype ($$;@) { } my $regexp=IkiWiki::glob2re($wanted); - if ($mimetype!~/^$regexp$/i) { + if ($mimetype!~$regexp) { return IkiWiki::FailReason->new("file MIME type is $mimetype, not $wanted"); } else {