plugin => {
safe => 1,
rebuild => undef,
+ section => "widget",
},
}
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}) {
(exists $params{alt} ? ' alt="'.$params{alt}.'"' : '').
(exists $params{title} ? ' title="'.$params{title}.'"' : '').
(exists $params{class} ? ' class="'.$params{class}.'"' : '').
+ (exists $params{align} && ! exists $params{caption} ? ' align="'.$params{align}.'"' : '').
(exists $params{id} ? ' id="'.$params{id}.'"' : '').
' />';
- my $alignclass=exists $params{align} ? "align-$params{align}" : "";
-
my $link;
if (! defined $params{link}) {
$link=$fileurl;
}
if (defined $link) {
- $imgtag='<a href="'.$link.'"'.
- (!exists $params{caption} && $alignclass ? ' class="'.$alignclass.'"' : '').
- '>'.$imgtag.'</a>';
+ $imgtag='<a href="'.$link.'">'.$imgtag.'</a>';
}
else {
my $b = bestlink($params{page}, $params{link});
$imgtag=htmllink($params{page}, $params{destpage},
$params{link}, linktext => $imgtag,
noimageinline => 1,
- (!exists $params{caption} && $alignclass) ?
- (class => $alignclass) : (),
);
}
}
if (exists $params{caption}) {
return '<table class="img'.
- ($alignclass ? ' '.$alignclass : '').
+ (exists $params{align} ? " align-$params{align}" : "").
'">'.
'<caption>'.$params{caption}.'</caption>'.
'<tr><td>'.$imgtag.'</td></tr>'.