diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-07-03 17:25:05 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-07-03 17:25:05 +0000 |
| commit | fe61a8e6265d8e4d800c61657c9eda214f5cff81 (patch) | |
| tree | 9c78237398a3f5dffee23c6d8093ae0c8135f831 /roundcubemail/program/include/rcube_contacts.inc | |
| parent | 2ee124c0ad4ee0a9f81482ab71d46fb0a703410e (diff) | |
Fix address adding bug reported by David Koblas
git-svn-id: https://svn.roundcube.net/trunk@638 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_contacts.inc')
| -rw-r--r-- | roundcubemail/program/include/rcube_contacts.inc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/roundcubemail/program/include/rcube_contacts.inc b/roundcubemail/program/include/rcube_contacts.inc index 3902e2a3b..c6dc40dfd 100644 --- a/roundcubemail/program/include/rcube_contacts.inc +++ b/roundcubemail/program/include/rcube_contacts.inc @@ -171,7 +171,7 @@ class rcube_contacts * @param boolean True if results are requested, False if count only * @return Indexed list of contact records and 'count' value */ - function search($fields, $value, $select=true) + function search($fields, $value, $strict=false, $select=true) { if (!is_array($fields)) $fields = array($fields); @@ -184,6 +184,8 @@ class rcube_contacts $ids = !is_array($value) ? split(',', $value) : $value; $add_where[] = $this->primary_key." IN (".join(',', $ids).")"; } + else if ($strict) + $add_where[] = $this->db->quoteIdentifier($col)."=".$this->db->quote($value); else $add_where[] = $this->db->quoteIdentifier($col)." LIKE ".$this->db->quote(strlen($value)>2 ? "%$value%" : "$value%"); } @@ -278,7 +280,7 @@ class rcube_contacts $insert_id = $existing = false; if ($check) - $existing = $this->search('email', $save_data['email'], false); + $existing = $this->search('email', $save_data['email'], true, false); $a_insert_cols = $a_insert_values = array(); foreach ($this->table_cols as $col) |
