Prevent from PHP warning when search string is empty
This commit is contained in:
parent
cdca86d15b
commit
480993ec15
1 changed files with 5 additions and 1 deletions
|
@ -363,6 +363,8 @@ class rcube_kolab_contacts extends rcube_addressbook
|
|||
$search = $value;
|
||||
}
|
||||
|
||||
$s_len = strlen($search);
|
||||
|
||||
foreach ((array)$contact[$col] as $val) {
|
||||
// composite field, e.g. address
|
||||
if (is_array($val)) {
|
||||
|
@ -370,7 +372,9 @@ class rcube_kolab_contacts extends rcube_addressbook
|
|||
}
|
||||
$val = mb_strtolower($val);
|
||||
|
||||
if (($strict && $val == $search) || (!$strict && strpos($val, $search) !== false)) {
|
||||
if (($strict && $val == $search)
|
||||
|| (!$strict && $s_len && strpos($val, $search) !== false)
|
||||
) {
|
||||
if (!$advanced) {
|
||||
$this->filter['ids'][] = $id;
|
||||
break 2;
|
||||
|
|
Loading…
Add table
Reference in a new issue