From 69c64a53bd75cb2cdbff61d7debb9fff23ea64fd Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" Date: Mon, 4 Nov 2002 21:55:10 +0000 Subject: [PATCH] Bug 177436 User matching shouldn't be case-sensitive patch by not_erik 2xr=justdave a=justdave for 2.17.1 git-svn-id: svn://10.0.0.236/trunk@132942 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/Bugzilla/User.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mozilla/webtools/bugzilla/Bugzilla/User.pm b/mozilla/webtools/bugzilla/Bugzilla/User.pm index 7b167d0c059..1506e5dde34 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/User.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/User.pm @@ -90,7 +90,7 @@ sub match { return \@users if $str =~ /^\s*$/; - # The search order is wildcards, then exact match, then INSTR search. + # The search order is wildcards, then exact match, then substring search. # Wildcard matching is skipped if there is no '*', and exact matches will # not (?) have a '*' in them. If any search comes up with something, the # ones following it will not execute. @@ -134,19 +134,19 @@ sub match { &::PopGlobalSQLState(); } - # then try instr + # then try substring search if ((scalar(@users) == 0) && (&::Param('usermatchmode') eq 'search') && (length($str) >= 3)) { - my $sqlstr = &::SqlQuote($str); + my $sqlstr = &::SqlQuote(uc($str)); my $query = "SELECT userid, realname, login_name " . "FROM profiles " . - "WHERE (INSTR(login_name, $sqlstr) " . - "OR INSTR(realname, $sqlstr)) "; + "WHERE (INSTR(UPPER(login_name), $sqlstr) " . + "OR INSTR(UPPER(realname), $sqlstr)) "; $query .= "AND disabledtext = '' " if $exclude_disabled; $query .= "ORDER BY length(login_name) "; $query .= "LIMIT $limit " if $limit;