summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Search/Quicksearch.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Search/Quicksearch.pm')
-rw-r--r--Bugzilla/Search/Quicksearch.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/Bugzilla/Search/Quicksearch.pm b/Bugzilla/Search/Quicksearch.pm
index df4383ef9..17a371c35 100644
--- a/Bugzilla/Search/Quicksearch.pm
+++ b/Bugzilla/Search/Quicksearch.pm
@@ -310,7 +310,7 @@ sub _handle_special_first_chars {
if ($firstChar eq '#') {
addChart('short_desc', 'substring', $baseWord, $negate);
- addChart('content', 'matches', $baseWord, $negate);
+ addChart('content', 'matches', _matches_phrase($baseWord), $negate);
return 1;
}
if ($firstChar eq ':') {
@@ -470,7 +470,7 @@ sub _default_quicksearch_word {
addChart('alias', 'substring', $word, $negate);
addChart('short_desc', 'substring', $word, $negate);
addChart('status_whiteboard', 'substring', $word, $negate);
- addChart('content', 'matches', $word, $negate);
+ addChart('content', 'matches', _matches_phrase($word), $negate);
}
sub _handle_urls {
@@ -522,6 +522,13 @@ sub splitString {
return @parts;
}
+# Quote and escape a phrase appropriately for a "content matches" search.
+sub _matches_phrase {
+ my ($phrase) = @_;
+ $phrase =~ s/"/\\"/g;
+ return "\"$phrase\"";
+}
+
# Expand found prefixes to states or resolutions
sub matchPrefixes {
my $hr_states = shift;