Fixed issue with folders which names are resolved to numeric identifiers

This commit is contained in:
Aleksander Machniak (Kolab Systems) 2011-07-27 19:13:38 +02:00
parent 08b23c4042
commit 7940612da5

View file

@ -135,10 +135,17 @@ class kolab_addressbook extends rcube_plugin
// Add personal address sources to the list
if ($abook_prio == self::PERSONAL_FIRST) {
$p['sources'] = array_merge($sources, $p['sources']);
// $p['sources'] = array_merge($sources, $p['sources']);
// Don't use array_merge(), because if you have folders name
// that resolve to numeric identifier it will break output array keys
foreach ($p['sources'] as $idx => $value)
$sources[$idx] = $value;
$p['sources'] = $sources;
}
else {
$p['sources'] = array_merge($p['sources'], $sources);
// $p['sources'] = array_merge($p['sources'], $sources);
foreach ($sources as $idx => $value)
$p['sources'][$idx] = $value;
}
return $p;