[Rt-commit] rt branch, 4.2/status-with-quote, created. rt-4.2.3-172-gd48afa2
Alex Vandiver
alexmv at bestpractical.com
Wed Apr 30 17:08:39 EDT 2014
The branch, 4.2/status-with-quote has been created
at d48afa239779ec2e7325aa98cf43736019d5ffab (commit)
- Log -----------------------------------------------------------------
commit d48afa239779ec2e7325aa98cf43736019d5ffab
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Apr 30 17:06:54 2014 -0400
Don't alter @statuses when escaping
The existing line to escape statuses altered @statuses in the process,
causing ->IsValid() to return false on the escaped versions, and thus
failto display any statuses which contained quotes or slashes. Store
the escaped versions in a different variable, to ensure that un-escaped
status names are passed around everywhere, and only escape them
as-needed.
Fixes I#29056.
diff --git a/share/html/Elements/QueueSummaryByLifecycle b/share/html/Elements/QueueSummaryByLifecycle
index ce6655c..9f7b943 100644
--- a/share/html/Elements/QueueSummaryByLifecycle
+++ b/share/html/Elements/QueueSummaryByLifecycle
@@ -94,11 +94,14 @@ my $build_search_link = sub {
my $link_all = sub {
my ($queue, $all_statuses) = @_;
- return $build_search_link->($queue->{Name}, "(".join(" OR ", map "Status = '$_'", @$all_statuses).")");
+ my @escaped = @{$all_statuses};
+ s{(['\\])}{\\$1}g for @escaped;
+ return $build_search_link->($queue->{Name}, "(".join(" OR ", map "Status = '$_'", @escaped).")");
};
my $link_status = sub {
my ($queue, $status) = @_;
+ $status =~ s{(['\\])}{\\$1}g;
return $build_search_link->($queue->{Name}, "Status = '$status'");
};
@@ -145,9 +148,11 @@ my $statuses = {};
use RT::Report::Tickets;
my $report = RT::Report::Tickets->new( RT->SystemUser );
+my @escaped = @statuses;
+s{(['\\])}{\\$1}g for @escaped;
my $query =
"(".
- join(" OR ", map {s{(['\\])}{\\$1}g; "Status = '$_'"} @statuses) #'
+ join(" OR ", map {"Status = '$_'"} @escaped) #'
.") AND (".
join(' OR ', map "Queue = ".$_->{id}, @queues)
.")";
-----------------------------------------------------------------------
More information about the rt-commit
mailing list