]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/img.pm
Make srcfile() return undef, if the file isn't there.
[git.ikiwiki.info.git] / IkiWiki / Plugin / img.pm
index c1048d3c927c3fad75c9a7b88b32dbe3833aa814..82db15a7ea3a6b5cf47b1cb93010792e765479fc 100644 (file)
@@ -26,6 +26,10 @@ sub preprocess (@) {
        my ($image) = $_[0] =~ /$config{wiki_file_regexp}/; # untaint
        my %params=@_;
 
+       if (! defined $image) {
+               error("bad image filename");
+       }
+
        if (exists $imgdefaults{$params{page}}) {
                foreach my $key (keys %{$imgdefaults{$params{page}}}) {
                        if (! exists $params{$key}) {