]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 366120: QuickSearch gets confused by colons in quotes - Patch by Teemu Mannermaa...
authorlpsolit%gmail.com <>
Sat, 17 Mar 2007 04:17:34 +0000 (04:17 +0000)
committerlpsolit%gmail.com <>
Sat, 17 Mar 2007 04:17:34 +0000 (04:17 +0000)
Bugzilla/Search/Quicksearch.pm
Bugzilla/Util.pm

index 4cb34eda8938857d6e3614f5c26d8c90b4a4ead3..83746ed5f0ddd4435e3972a7c54592607297f1d4 100644 (file)
@@ -409,28 +409,22 @@ sub splitString {
     my @parts;
     my $i = 0;
 
-    # Escape backslashes
-    $string =~ s/\\/\\\//g;
-
     # Now split on quote sign; be tolerant about unclosed quotes
     @quoteparts = split(/"/, $string);
-    foreach (@quoteparts) {
-        # After every odd quote, escape whitespace
-        s/(\s)/\\$1/g if $i++ % 2;
+    foreach my $part (@quoteparts) {
+        # After every odd quote, quote special chars
+        $part = url_quote($part) if $i++ % 2;
     }
     # Join again
     $string = join('"', @quoteparts);
 
     # Now split on unescaped whitespace
-    @parts = split(/(?<!\\)\s+/, $string);
+    @parts = split(/\s+/, $string);
     foreach (@parts) {
-        # Restore whitespace
-        s/\\(\s)/$1/g;
-        # Restore backslashes
-        s/\\\//\\/g;
         # Remove quotes
         s/"//g;
     }
+                        
     return @parts;
 }
 
@@ -501,7 +495,7 @@ sub makeChart {
     my $cgi = Bugzilla->cgi;
     $cgi->param("field$expr", $field);
     $cgi->param("type$expr",  $type);
-    $cgi->param("value$expr", $value);
+    $cgi->param("value$expr", url_decode($value));
 }
 
 1;
index 4a87ff042026e48aa4640792d70b710a5d4d14b4..e97bb11d0cb2f17983cd55c7b8ecfadcaaf4d542 100644 (file)
@@ -34,7 +34,7 @@ use base qw(Exporter);
 @Bugzilla::Util::EXPORT = qw(is_tainted trick_taint detaint_natural
                              detaint_signed
                              html_quote url_quote value_quote xml_quote
-                             css_class_quote html_light_quote
+                             css_class_quote html_light_quote url_decode
                              i_am_cgi get_netaddr correct_urlbase
                              lsearch
                              diff_arrays diff_strings