X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/91f5697025ce92e64ad9d02c122d6a8d6df22278..d4128e899528c972262efc043eb89ebb34c068bd:/IkiWiki/Plugin/filecheck.pm diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm index a78058ffe..4f4e67489 100644 --- a/IkiWiki/Plugin/filecheck.pm +++ b/IkiWiki/Plugin/filecheck.pm @@ -148,6 +148,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 +161,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 {