summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Search
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-09-23 16:38:54 +0200
committerByron Jones <bjones@mozilla.com>2013-09-23 16:38:54 +0200
commit92d593d895f6fab1f5627493ab3cd0c66446f184 (patch)
tree5dda6e8a8f1207e215fbf7fd2a9f2641151ed119 /Bugzilla/Search
parentd6f683c849a41d1fc76f714f77cfaa8db3c0379c (diff)
downloadbugzilla-92d593d895f6fab1f5627493ab3cd0c66446f184.tar.gz
bugzilla-92d593d895f6fab1f5627493ab3cd0c66446f184.tar.xz
Bug 918647: "Use of uninitialized value" warnings when using quicksearch
Diffstat (limited to 'Bugzilla/Search')
-rw-r--r--Bugzilla/Search/Quicksearch.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/Bugzilla/Search/Quicksearch.pm b/Bugzilla/Search/Quicksearch.pm
index 6ea28169c..bc25bb4c0 100644
--- a/Bugzilla/Search/Quicksearch.pm
+++ b/Bugzilla/Search/Quicksearch.pm
@@ -281,6 +281,8 @@ sub quicksearch {
sub _parse_line {
my ($delim, $keep, $line) = @_;
+ return () unless defined $line;
+
# parse_line always treats ' as a quote character, making it impossible
# to sanely search for contractions. As this behavour isn't
# configurable, we replace ' with a placeholder to hide it from the
@@ -295,7 +297,7 @@ sub _parse_line {
my @words = parse_line($delim, $keep, $line);
foreach my $word (@words) {
- $word =~ tr/\000/'/;
+ $word =~ tr/\000/'/ if defined $word;
}
return @words;
}
@@ -366,7 +368,7 @@ sub _handle_status_and_resolution {
sub _handle_special_first_chars {
my ($qsword, $negate) = @_;
- return if $qsword eq '';
+ return 0 if !defined $qsword || length($qsword) <= 1;
my $firstChar = substr($qsword, 0, 1);
my $baseWord = substr($qsword, 1);