filecheck: accept MIME types that don't contain ';'

master
Simon McVittie 2014-09-10 09:00:20 +01:00
parent aed4e03b0c
commit 77a2267dcf
1 changed files with 3 additions and 1 deletions

View File

@ -150,7 +150,7 @@ sub match_mimetype ($$;@) {
chomp $mimetype; chomp $mimetype;
close $file_h; close $file_h;
} }
if (! defined $mimetype || $mimetype !~s /;.*//) { if (! defined $mimetype) {
# Fall back to default value. # Fall back to default value.
$mimetype=File::MimeInfo::Magic::default($file) $mimetype=File::MimeInfo::Magic::default($file)
if $mimeinfo_ok; if $mimeinfo_ok;
@ -158,6 +158,8 @@ sub match_mimetype ($$;@) {
$mimetype="unknown"; $mimetype="unknown";
} }
} }
# Ignore any parameters, we only want the type itself
$mimetype =~ s/;.*//;
my $regexp=IkiWiki::glob2re($wanted); my $regexp=IkiWiki::glob2re($wanted);
if ($mimetype!~$regexp) { if ($mimetype!~$regexp) {