plugin => {
safe => 1,
rebuild => undef,
- section => "misc",
},
}
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
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;
$mimetype="unknown";
}
}
+ # Ignore any parameters, we only want the type itself
+ $mimetype =~ s/;.*//;
my $regexp=IkiWiki::glob2re($wanted);
if ($mimetype!~$regexp) {