diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2010-03-25 14:39:09 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2010-03-25 14:39:09 -0400 |
commit | 3d671ea8c1df4534d8ffa59b235dd6ded99bb13f (patch) | |
tree | 32f3d7f75a7422a8c6867d93ce4c7db933624268 /IkiWiki | |
parent | b19fb349f57e7dd9914aae728c5243dc6640026f (diff) | |
download | ikiwiki-3d671ea8c1df4534d8ffa59b235dd6ded99bb13f.tar ikiwiki-3d671ea8c1df4534d8ffa59b235dd6ded99bb13f.tar.gz |
filecheck: Fix bug that prevented the pagespecs from matching when not called by attachment plugin.
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/filecheck.pm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm index 0501ba99c..1549b82db 100644 --- a/IkiWiki/Plugin/filecheck.pm +++ b/IkiWiki/Plugin/filecheck.pm @@ -75,9 +75,9 @@ sub match_maxsize ($$;@) { } my %params=@_; - my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}; + my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page}); if (! defined $file) { - return IkiWiki::ErrorReason->new("no file specified"); + return IkiWiki::ErrorReason->new("file does not exist"); } if (-s $file > $maxsize) { @@ -96,9 +96,9 @@ sub match_minsize ($$;@) { } my %params=@_; - my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}; + my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page}); if (! defined $file) { - return IkiWiki::ErrorReason->new("no file specified"); + return IkiWiki::ErrorReason->new("file does not exist"); } if (-s $file < $minsize) { @@ -114,9 +114,9 @@ sub match_mimetype ($$;@) { my $wanted=shift; my %params=@_; - my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}; + my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page}); if (! defined $file) { - return IkiWiki::ErrorReason->new("no file specified"); + return IkiWiki::ErrorReason->new("file does not exist"); } # Use ::magic to get the mime type, the idea is to only trust @@ -147,9 +147,9 @@ sub match_virusfree ($$;@) { my $wanted=shift; my %params=@_; - my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}; + my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page}); if (! defined $file) { - return IkiWiki::ErrorReason->new("no file specified"); + return IkiWiki::ErrorReason->new("file does not exist"); } if (! exists $IkiWiki::config{virus_checker} || |