[Rt-commit] r12974 - in rt/branches/3.8-TESTING: lib/RT/Search

elacour at bestpractical.com elacour at bestpractical.com
Fri Jun 6 12:11:41 EDT 2008


Author: elacour
Date: Fri Jun  6 12:11:40 2008
New Revision: 12974

Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/lib/RT/Search/Googleish.pm

Log:
 r9253 at datura:  manu | 2008-06-06 18:11:20 +0200
 RT-Ticket: 5819
 RT-Status: resolved
 RT-Update: correspond
 
 Fix QuickSearch on queues with quotes in name.
 


Modified: rt/branches/3.8-TESTING/lib/RT/Search/Googleish.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Search/Googleish.pm	(original)
+++ rt/branches/3.8-TESTING/lib/RT/Search/Googleish.pm	Fri Jun  6 12:11:40 2008
@@ -124,12 +124,13 @@
             push @status_clauses, "Status = '" . $key . "'";
         }
 
-        # Is there a owner named $key?
         # Is there a queue named $key?
         elsif ( $Queue = RT::Queue->new( $self->TicketsObj->CurrentUser )
             and $Queue->Load($key) )
         {
-            push @queue_clauses, "Queue = '" . $Queue->Name . "'";
+            my $quoted_queue = $Queue->Name;
+            $quoted_queue =~ s/'/\\'/g;
+            push @queue_clauses, "Queue = '$quoted_queue'";
         }
 
         # Is there a owner named $key?
@@ -151,7 +152,9 @@
     for my $queue (@{ $self->{'Queues'} }) {
         my $QueueObj = RT::Queue->new($self->TicketsObj->CurrentUser);
         $QueueObj->Load($queue) or next;
-        push @queue_clauses, "Queue = '" . $QueueObj->Name . "'";
+        my $quoted_queue = $Queue->Name;
+        $quoted_queue =~ s/'/\\'/g;
+        push @queue_clauses, "Queue = '$quoted_queue'";
     }
 
     push @tql_clauses, join( " OR ", sort @id_clauses );


More information about the Rt-commit mailing list