From 8b5007c9872a1d9757c13dd8052b029c81437d63 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Mon, 13 May 2002 23:39:30 +0000 Subject: [PATCH] case-insensitive check for 1st char (some rdbms) --- phpgwapi/inc/class.contacts_sql.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.contacts_sql.inc.php b/phpgwapi/inc/class.contacts_sql.inc.php index 5fb0f6357a..f66a4d03c7 100644 --- a/phpgwapi/inc/class.contacts_sql.inc.php +++ b/phpgwapi/inc/class.contacts_sql.inc.php @@ -484,6 +484,9 @@ if($cquery) { + $cqueryl = strtolower($cquery); + $cqueryu = strtoupper($cquery); + $sql = "SELECT * FROM $this->std_table WHERE ("; $cfields = array( 'fn' => 'cn', @@ -492,10 +495,11 @@ ); while(list($f,$x) = each($cfields)) { - $sql .= " $f LIKE '$cquery%' OR "; + $sql .= " $f LIKE '$cqueryl%' OR $f LIKE '$cqueryu%' OR "; } $sql = substr($sql,0,-3) . ') ' . $fand . $filtermethod . $ordermethod; unset($f); unset($x); + unset($cqueryl); unset($cqueryu); } elseif($query) {