Photos
Blog
Projects
vanrenterghem.biz
projects
/
git.ikiwiki.info.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
po(delete): added hook, and function skeleton
[git.ikiwiki.info.git]
/
IkiWiki
/
Plugin
/
filecheck.pm
diff --git
a/IkiWiki/Plugin/filecheck.pm
b/IkiWiki/Plugin/filecheck.pm
index 1855a8b48720baece395eeb06b4f2e1f84d701e4..27f764e3b344a344ef2d491552824c2c40e6e5f1 100644
(file)
--- a/
IkiWiki/Plugin/filecheck.pm
+++ b/
IkiWiki/Plugin/filecheck.pm
@@
-69,7
+69,7
@@
package IkiWiki::PageSpec;
sub match_maxsize ($$;@) { #{{{
my $page=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)");
}
if ($@) {
return IkiWiki::FailReason->new("unable to parse maxsize (or number too large)");
}
@@
-90,7
+90,7
@@
sub match_maxsize ($$;@) { #{{{
sub match_minsize ($$;@) { #{{{
my $page=shift;
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)");
}
if ($@) {
return IkiWiki::FailReason->new("unable to parse minsize (or number too large)");
}
@@
-127,7
+127,10
@@
sub match_mimetype ($$;@) { #{{{
}
my $mimetype=File::MimeInfo::Magic::magic($file);
if (! defined $mimetype) {
}
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);
}
my $regexp=IkiWiki::glob2re($wanted);