diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-06-04 00:21:24 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-06-04 00:21:24 -0700 |
commit | 679854b8bbc65d112071111bbd7f34a6a481fb30 (patch) | |
tree | dda0862fdf7853f4f61e4cf155c8bbc93768c994 /rt/share/html/Elements/MakeClicky | |
parent | 9b328d940af56b9924a342192ebb0790478fa705 (diff) |
RT 4.0.13
Diffstat (limited to 'rt/share/html/Elements/MakeClicky')
-rw-r--r-- | rt/share/html/Elements/MakeClicky | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/rt/share/html/Elements/MakeClicky b/rt/share/html/Elements/MakeClicky index 57964f7a9..dabe3bb33 100644 --- a/rt/share/html/Elements/MakeClicky +++ b/rt/share/html/Elements/MakeClicky @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -48,20 +48,27 @@ <%ONCE> use Regexp::Common qw(URI); +my $escaper = sub { + my $content = shift; + RT::Interface::Web::EscapeUTF8( \$content ); + return $content; +}; + my %actions = ( default => sub { my %args = @_; - return $args{value}; + return $escaper->($args{value}); }, url => sub { my %args = @_; + $args{value} = $escaper->($args{value}); my $result = qq{[<a target="new" href="$args{value}">}. loc('Open URL') .qq{</a>]}; return $args{value} . qq{ <span class="clickylink">$result</span>}; }, url_overwrite => sub { my %args = @_; - my $result = qq{<a target="new" href="$args{'value'}">}; - $result .= qq{$args{'value'}</a>}; + $args{value} = $escaper->($args{value}); + my $result = qq{<a target="new" href="$args{value}">$args{value}</a>}; return qq{<span class="clickylink">$result</span>}; }, ); @@ -89,12 +96,6 @@ my $handle = sub { } }; -my $escaper = sub { - my $content = shift; - RT::Interface::Web::EscapeUTF8( \$content ); - return $content; -}; - # Hook to add more Clicky types # XXX Have to have Page argument, as Mason gets caller wrong in Callback? # This happens as we are in <%ONCE> block |