[Rt-commit] [rtir] 02/02: Start returning early if we're acting on a non-RTIR ticket.
Kevin Falcone
falcone at bestpractical.com
Tue Jan 28 16:59:59 EST 2014
This is an automated email from the git hooks/post-receive script.
falcone pushed a commit to branch 3.0/disable-rtir-linking-outside-rtir-queues
in repository rtir.
commit ca41f89a8a438e5472e323d531d6bcb3675b1207
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Tue Jan 28 16:51:54 2014 -0500
Start returning early if we're acting on a non-RTIR ticket.
Otherwise, example.com or email addresses anywhere in the history of a
ticket in the General queue ends up with links off to
/RTIR/Tools/Lookup.html. Normal users have no idea why those links are
there and they're frankly ugly and cluttering outside the RTIR workflow.
---
html/Callbacks/RTIR/Elements/MakeClicky/Default | 28 +++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/html/Callbacks/RTIR/Elements/MakeClicky/Default b/html/Callbacks/RTIR/Elements/MakeClicky/Default
index 06355b5..d59481e 100644
--- a/html/Callbacks/RTIR/Elements/MakeClicky/Default
+++ b/html/Callbacks/RTIR/Elements/MakeClicky/Default
@@ -64,6 +64,8 @@ my %actions;
default => sub {
my %args = @_;
$args{value} = $escaper->($args{value});
+ # don't execute on non-rtir tickets
+ return $args{value} unless defined $args{type};
return qq{<a href="$web_path/RTIR/Tools/Lookup.html?$args{lookup_params}q=$args{value}">$args{value}</a>};
},
url => sub {
@@ -73,6 +75,9 @@ my %actions;
my $escaped_host = $escaper->($host);
my $super = $super{url} ? $super{url}->(%args) : $escaper->($args{value});
+ # don't execute on non-rtir tickets
+ return $super unless defined $args{type};
+
my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?$args{lookup_params}type=host&q=$escaped_host">}
.loc('lookup "[_1]"', $host) .qq{</a>]};
return $super . qq{ <span class="clickylink">$result</span>};
@@ -84,12 +89,19 @@ my %actions;
my $escaped_host = $escaper->($host);
my $super = $super{url_overwrite} ? $super{url_overwrite}->(%args) : $escaper->($args{value});
+ # don't execute on non-rtir tickets
+ return $super unless defined $args{type};
+
my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?$args{lookup_params}type=host&q=$escaped_host">}
.loc('lookup "[_1]"', $host) .qq{</a>]};
return $super . qq{ <span class="clickylink">$result</span>};
},
ip => sub {
my %args = @_;
+
+ # don't execute on non-rtir tickets
+ return $escaper->($args{value}) unless defined $args{type};
+
$args{host} ||= $args{value};
my $escaped_host = $escaper->($args{host});
my $result .= qq{[<a href="$web_path/RTIR/Tools/Lookup.html?$args{lookup_params}type=ip&q=$escaped_host">}
@@ -108,6 +120,10 @@ my %actions;
},
ipdecimal => sub {
my %args = @_;
+
+ # don't execute on non-rtir tickets
+ return $escaper->($args{value}) unless defined $args{type};
+
my $i = unpack "L",$args{value};
return $args{value} unless $args{value} > 33554432;
@@ -123,6 +139,10 @@ my %actions;
},
email => sub {
my %args = @_;
+
+ # don't execute on non-rtir tickets
+ return $escaper->($args{value}) unless defined $args{type};
+
my $email = $args{'value'}; $email =~ s/^<|>$//g;
my $escaped_email = $escaper->($email);
@@ -144,6 +164,10 @@ my %actions;
},
noc => sub {
my %args = @_;
+
+ # don't execute on non-rtir tickets
+ return $escaper->($args{value}) unless defined $args{type};
+
$args{value} = $escaper->($args{value});
my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?$args{lookup_params}type=handle&q=$args{value}">}
.loc('lookup') .qq{</a>]};
@@ -151,6 +175,10 @@ my %actions;
},
host => sub {
my %args = @_;
+
+ # don't execute on non-rtir tickets
+ return $escaper->($args{value}) unless defined $args{type};
+
$args{value} = $escaper->($args{value});
my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?$args{lookup_params}type=host&q=$args{value}">}
.loc('lookup host') .qq{</a>]};
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list