Changeset 1637 in subversion
- Timestamp:
- Aug 9, 2008 4:20:59 PM (5 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 4 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_contacts.php (modified) (1 diff)
-
program/include/rcube_db.php (modified) (1 diff)
-
program/include/rcube_mdb2.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r1623 r1637 1 1 CHANGELOG RoundCube Webmail 2 2 --------------------------- 3 4 2008/08/09 (alec) 5 ---------- 6 - Case insensitive contacts searching using PostgreSQL (#1485259) 3 7 4 8 2008/07/31 (thomasb) -
trunk/roundcubemail/program/include/rcube_contacts.php
r1387 r1637 197 197 { 198 198 $ids = !is_array($value) ? split(',', $value) : $value; 199 $add_where[] = $this->primary_key. " IN (".join(',', $ids).")";199 $add_where[] = $this->primary_key.' IN ('.join(',', $ids).')'; 200 200 } 201 201 else if ($strict) 202 $add_where[] = $this->db->quoteIdentifier($col). "=".$this->db->quote($value);202 $add_where[] = $this->db->quoteIdentifier($col).'='.$this->db->quote($value); 203 203 else 204 $add_where[] = $this->db-> quoteIdentifier($col)." LIKE ".$this->db->quote(strlen($value)>2 ? "%$value%" : "$value%");204 $add_where[] = $this->db->ilike($col, '%'.$value.'%'); 205 205 } 206 206 -
trunk/roundcubemail/program/include/rcube_db.php
r1291 r1637 512 512 513 513 /** 514 * Return SQL statement for case insensitive LIKE 515 * 516 * @param string Field name 517 * @param string Search value 518 * @return string SQL statement to use in query 519 * @access public 520 */ 521 function ilike($column, $value) 522 { 523 switch($this->db_provider) 524 { 525 case 'pgsql': 526 return $this->quote_identifier($column).' ILIKE '.$this->quote($value); 527 default: 528 return $this->quote_identifier($column).' LIKE '.$this->quote($value); 529 } 530 } 531 532 533 /** 514 534 * Adds a query result and returns a handle ID 515 535 * -
trunk/roundcubemail/program/include/rcube_mdb2.php
r1631 r1637 510 510 511 511 /** 512 * Return SQL statement for case insensitive LIKE 513 * 514 * @param string Field name 515 * @param string Search value 516 * @return string SQL statement to use in query 517 * @access public 518 */ 519 function ilike($column, $value) 520 { 521 // TODO: use MDB2's matchPattern() function 522 switch($this->db_provider) 523 { 524 case 'pgsql': 525 return $this->quote_identifier($column).' ILIKE '.$this->quote($value); 526 default: 527 return $this->quote_identifier($column).' LIKE '.$this->quote($value); 528 } 529 } 530 531 532 /** 512 533 * Adds a query result and returns a handle ID 513 534 *
Note: See TracChangeset
for help on using the changeset viewer.
