From a094f0ebf0294b8f964fc3d93e4d60044af8353e Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Wed, 31 Aug 2005 15:00:23 +0000 Subject: Bug 305976: Allow Bugzilla::DB sql_regexp/sql_not_regexp methods to accept string and pattern as arguments Patch By Lance Larsh r=joel, a=justdave --- contrib/BugzillaEmail.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'contrib') diff --git a/contrib/BugzillaEmail.pm b/contrib/BugzillaEmail.pm index 473169c9e..db31d1f24 100644 --- a/contrib/BugzillaEmail.pm +++ b/contrib/BugzillaEmail.pm @@ -16,6 +16,7 @@ # Gregor Fischer # Klaas Freitag # Seth Landsman +# Lance Larsh # The purpose of this module is to abstract out a bunch of the code # that is central to email interfaces to bugzilla and its database @@ -54,8 +55,8 @@ sub findUser($) { return $found_address; } elsif ($email_transform eq $EMAIL_TRANSFORM_BASE_DOMAIN) { my ($username) = ($address =~ /(.+)@/); - my $stmt = "SELECT login_name FROM profiles WHERE " . $dbh->sql_istrcmp( - 'login_name', $dbh->quote($username), $dbh->sql_regexp()); + my $stmt = "SELECT login_name FROM profiles WHERE " . $dbh->sql_regexp( + $dbh->sql_istring('login_name'), $dbh->sql_istring($dbh->quote($username))); SendSQL($stmt); my $domain; @@ -72,8 +73,8 @@ sub findUser($) { return $new_address; } elsif ($email_transform eq $EMAIL_TRANSFORM_NAME_ONLY) { my ($username) = ($address =~ /(.+)@/); - my $stmt = "SELECT login_name FROM profiles WHERE " .$dbh->sql_istrcmp( - 'login_name', $dbh->quote($username), $dbh->sql_regexp()); + my $stmt = "SELECT login_name FROM profiles WHERE " .$dbh->sql_regexp( + $dbh->sql_istring('login_name'), $dbh->sql_istring($dbh->quote($username))); SendSQL($stmt); my $found_address = FetchOneColumn(); return $found_address; -- cgit v1.2.3-24-g4f1b