#1485229: fixed mailboxlist sorting for folder names with upper case

release-0.6
alecpl 17 years ago
parent 8791df8bab
commit f219a20fff

@ -2539,19 +2539,19 @@ class rcube_imap
$folders = array_merge($a_defaults, array_keys($folders)); $folders = array_merge($a_defaults, array_keys($folders));
// finally we must rebuild the list to move // finally we must rebuild the list to move
// subfolders of default folders to their place // subfolders of default folders to their place...
// ...also do this for the rest of folders because
// asort() is not properly sorting case sensitive names
while (list($key, $folder) = each($folders)) { while (list($key, $folder) = each($folders)) {
$a_out[] = $folder; $a_out[] = $folder;
unset($folders[$key]); unset($folders[$key]);
if (in_array(strtolower($folder), $this->default_folders_lc)) { foreach ($folders as $idx => $f) {
foreach ($folders as $idx => $f) { if (strpos($f, $folder.$delimiter) === 0) {
if (strpos($f, $folder.$delimiter) === 0) { $a_out[] = $f;
$a_out[] = $f; unset($folders[$idx]);
unset($folders[$idx]);
}
} }
reset($folders); }
} reset($folders);
} }
return $a_out; return $a_out;

Loading…
Cancel
Save