return $base;
} #}}}
+# This is provided for other plugins that want to convert back the other way.
sub humansize ($) { #{{{
my $size=shift;
sub match_maxsize ($$;@) { #{{{
my $page=shift;
- my $maxsize=eval{IkiWiki::Plugin::attachment::parsesize(shift)};
+ my $maxsize=eval{IkiWiki::Plugin::filecheck::parsesize(shift)};
if ($@) {
return IkiWiki::FailReason->new("unable to parse maxsize (or number too large)");
}
sub match_minsize ($$;@) { #{{{
my $page=shift;
- my $minsize=eval{IkiWiki::Plugin::attachment::parsesize(shift)};
+ my $minsize=eval{IkiWiki::Plugin::filecheck::parsesize(shift)};
if ($@) {
return IkiWiki::FailReason->new("unable to parse minsize (or number too large)");
}
}
my $mimetype=File::MimeInfo::Magic::magic($file);
if (! defined $mimetype) {
- $mimetype="unknown";
+ $mimetype=File::MimeInfo::Magic::default($file);
+ if (! defined $mimetype) {
+ $mimetype="unknown";
+ }
}
my $regexp=IkiWiki::glob2re($wanted);