$term = "$ff != $q";
},
",casesubstring" => sub {
- $term = $dbh->sql_position($q, $ff);
+ $term = $dbh->sql_position($q, $ff) . " > 0";
},
",substring" => sub {
- $term = $dbh->sql_position(lc($q), "LOWER($ff)");
+ $term = $dbh->sql_position(lc($q), "LOWER($ff)") . " > 0";
},
",substr" => sub {
$funcsbykey{",substring"}->();
} elsif ($type eq 'substring') {
&::SendSQL("SELECT userid FROM profiles WHERE " .
$dbh->sql_position(lc(::SqlQuote($email)), "LOWER(login_name)") .
- " " . $dbh->sql_limit(51));
+ " > 0 " . $dbh->sql_limit(51));
while (&::MoreSQLData()) {
my ($id) = &::FetchSQLData();
push(@list, $id);
foreach my $word (split(/[\s,]+/, $strs)) {
if ($word ne "") {
push(@list, $dbh->sql_position(lc(::SqlQuote($word)),
- "LOWER($field)"));
+ "LOWER($field)") . " > 0");
}
}
&& (length($str) >= 3))
{
- my $sqlstr = &::SqlQuote(uc($str));
+ my $sqlstr = &::SqlQuote(lc($str));
- my $query = "SELECT DISTINCT userid, realname, login_name, " .\r
+ my $query = "SELECT DISTINCT userid, realname, login_name, " .
"LENGTH(login_name) AS namelength " .
"FROM profiles";
if (&::Param('usevisibilitygroups')) {
$query .= ", user_group_map";
}
- $query .= " WHERE " . $dbh->sql_position($sqlstr,
- "UPPER(login_name)") .
- " OR " . $dbh->sql_position($sqlstr,
- "UPPER(realname)");
+ $query .= " WHERE " .
+ $dbh->sql_position($sqlstr, 'LOWER(login_name)') . " > 0" .
+ " OR " .
+ $dbh->sql_position($sqlstr, 'LOWER(realname)') . " > 0";
if (&::Param('usevisibilitygroups')) {
$query .= " AND user_group_map.user_id = userid" .
" AND isbless = 0" .
print "Removing paths from filenames in attachments table...\n";
$sth = $dbh->prepare("SELECT attach_id, filename FROM attachments " .
- "WHERE " . $dbh->sql_position(q{'/'}, 'filename') .
- " OR " . $dbh->sql_position(q{'\\\\'}, 'filename'));
+ "WHERE " . $dbh->sql_position(q{'/'}, 'filename') . " > 0 OR " .
+ $dbh->sql_position(q{'\\\\'}, 'filename') . " > 0");
$sth->execute;
while (my ($attach_id, $filename) = $sth->fetchrow_array) {