Following Joey's suggestion in
doc/forum/link_to_an_image_inside_the_wiki_without_inlining_it.mdwn
I also altered the directive syntax:
[[!ltio img="image1.jpg"]]
is now
[[!ltio image1.jpg]]
}
sub preprocess {
- my %params = @_;
- return "<a href='" . bestlink($params{"page"}, $params{"img"}) . "'>" . $params{"text"} . "</a>";
+ my ($image) = $_[0] =~ /$config{wiki_file_regexp}/; # untaint
+ my %params=@_;
+
+ if (! defined $image) {
+ error("bad image filename");
+ }
+
+ return htmllink($params{page}, $params{destpage}, $image,
+ linktext => $params{text},
+ noimageinline => 1);
}
1