alecpl
2011-06-03 5148d388ea954ccb0320bd5b2e963c9018820938
- Small fix for advanced searching


1 files modified
6 ■■■■ changed files
program/include/rcube_contacts.php 6 ●●●● patch | view | raw | blame | history
program/include/rcube_contacts.php
@@ -321,7 +321,7 @@
                $this->list_records(null, $i, true);
                while ($row = $this->result->next()) {
                    $id = $row[$this->primary_key];
                    $found = 0;
                    $found = array();
                    foreach (preg_grep($regexp, array_keys($row)) as $col) {
                        $pos     = strpos($col, ':');
                        $colname = $pos ? substr($col, 0, $pos) : $col;
@@ -333,13 +333,13 @@
                            }
                            $value = mb_strtolower($value);
                            if (($strict && $value == $search) || (!$strict && strpos($value, $search) !== false)) {
                                $found++;
                                $found[$colname] = true;
                                break;
                            }
                        }
                    }
                    // all fields match
                    if ($found >= $scnt) {
                    if (count($found) >= $scnt) {
                        $ids[] = $id;
                    }
                }