]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/filecheck.pm
filecheck: Fix bug that prevented the pagespecs from matching when not called by...
[ikiwiki.git] / IkiWiki / Plugin / filecheck.pm
index 0501ba99cb3e0a13c4b8a73204ee28bfeb785849..1549b82db75a9d5164c04b166a3d6d149bdb01dc 100644 (file)
@@ -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} ||