From: Simon McVittie Date: Wed, 10 Sep 2014 08:00:20 +0000 (+0100) Subject: filecheck: accept MIME types that don't contain ';' X-Git-Tag: 3.20140916~18^2 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/77a2267dcfb103b63a675e4a2226076166b29d3f filecheck: accept MIME types that don't contain ';' --- diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm index cdea5c706..6e6528398 100644 --- a/IkiWiki/Plugin/filecheck.pm +++ b/IkiWiki/Plugin/filecheck.pm @@ -150,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; @@ -158,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) {