summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjake%acutex.net <>2001-10-06 08:06:08 +0200
committerjake%acutex.net <>2001-10-06 08:06:08 +0200
commitf4d7db71f976784cf98affd65063a5643e10a1dc (patch)
tree70e3f767fc0a04f5354391d8f4dea11b84d64e13
parent0d14b47f13ff8c14843b9683b85c113ea95bf1cd (diff)
downloadbugzilla-f4d7db71f976784cf98affd65063a5643e10a1dc.tar.gz
bugzilla-f4d7db71f976784cf98affd65063a5643e10a1dc.tar.xz
Fix for bug 57821 - Empty regular expression causes a software error.
Patch by Nick Hibma <n_hibma@qubesoft.com> r= jake@acutex.net
-rwxr-xr-xeditusers.cgi9
1 files changed, 7 insertions, 2 deletions
diff --git a/editusers.cgi b/editusers.cgi
index 48dcfa0c1..b1c1d01d6 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -292,20 +292,25 @@ List users with login name matching:
if ($action eq 'list') {
PutHeader("Select user");
my $query = "";
+ my $matchstr = $::FORM{'matchstr'};
if (exists $::FORM{'matchtype'}) {
$query = "SELECT login_name,realname,disabledtext " .
"FROM profiles WHERE login_name ";
if ($::FORM{'matchtype'} eq 'substr') {
$query .= "like";
- $::FORM{'matchstr'} = '%' . $::FORM{'matchstr'} . '%';
+ $matchstr = '%' . $matchstr . '%';
} elsif ($::FORM{'matchtype'} eq 'regexp') {
$query .= "regexp";
+ $matchstr = '.'
+ unless $matchstr;
} elsif ($::FORM{'matchtype'} eq 'notregexp') {
$query .= "not regexp";
+ $matchstr = '.'
+ unless $matchstr;
} else {
die "Unknown match type";
}
- $query .= SqlQuote($::FORM{'matchstr'}) . " ORDER BY login_name";
+ $query .= SqlQuote($matchstr) . " ORDER BY login_name";
} elsif (exists $::FORM{'query'}) {
$query = "SELECT login_name,realname,disabledtext " .
"FROM profiles WHERE " . $::FORM{'query'} . " ORDER BY login_name";