From 4d7a3f5e86125533a3ac44b2eeb99051737bd1e5 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 9 Aug 2016 05:55:34 -0400 Subject: [PATCH] T1402: Fix bug where contact groups with the same name could be displayed as one --- plugins/kolab_addressbook/lib/rcube_kolab_contacts.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php index 3e2bc692..3da1fd26 100644 --- a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php +++ b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php @@ -302,12 +302,13 @@ class rcube_kolab_contacts extends rcube_addressbook $groups = array(); foreach ((array)$this->distlists as $group) { - if (!$search || strstr(strtolower($group['name']), strtolower($search))) - $groups[$group['name']] = array('ID' => $group['ID'], 'name' => $group['name']); + if (!$search || strstr(mb_strtolower($group['name']), mb_strtolower($search))) { + $groups[$group['ID']] = array('ID' => $group['ID'], 'name' => $group['name']); + } } - // sort groups - ksort($groups, SORT_LOCALE_STRING); + // sort groups by name + uasort($groups, function($a, $b) { return strcoll($a['name'], $b['name']); }); return array_values($groups); }