summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-11-15 09:22:13 +0000
committeralecpl <alec@alec.pl>2011-11-15 09:22:13 +0000
commit305b366bb0cc425e7feb817aca342b95fb17a716 (patch)
treef23bad7b8f1b43b7f85a9b372ebf4eb3161d638b /program
parent89dcf540719af6fc7161c45d5bc11e171afa3697 (diff)
- Fix commit r5424 + preformance microoptimizations
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_imap.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 4fe39e1ac..d56da3d26 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -3177,8 +3177,8 @@ class rcube_imap
foreach ((array)$namespace as $ns) {
if (is_array($ns)) {
foreach ($ns as $ns_data) {
- if ($len = strlen($ns_data[0])) {
- $search = array('len' => $len, 'prefix' => $ns_data[0]);
+ if (strlen($ns_data[0])) {
+ $search = $ns_data[0];
}
}
}
@@ -3186,9 +3186,9 @@ class rcube_imap
if (!empty($search)) {
// go through all folders detecting namespace usage
- foreach ($list as $folder) {
- foreach ($search as $idx => $s) {
- if ($s['prefix'] == substr($folder, 0, $s['len'])) {
+ foreach ($result as $folder) {
+ foreach ($search as $idx => $prefix) {
+ if (strpos($folder, $prefix) === 0) {
unset($search[$idx]);
}
}
@@ -3198,8 +3198,8 @@ class rcube_imap
}
// get folders in hidden namespaces and add to the result
- foreach ($search as $s) {
- $list = $this->conn->listMailboxes($s['prefix'], $name);
+ foreach ($search as $prefix) {
+ $list = $this->conn->listMailboxes($prefix, $name);
if (!empty($list)) {
$result = array_merge($result, $list);
@@ -3484,8 +3484,8 @@ class rcube_imap
foreach ($this->namespace as $type => $namespace) {
if (is_array($namespace)) {
foreach ($namespace as $ns) {
- if (strlen($ns[0])) {
- if ((strlen($ns[0])>1 && $mailbox == substr($ns[0], 0, -1))
+ if ($len = strlen($ns[0])) {
+ if (($len > 1 && $mailbox == substr($ns[0], 0, -1))
|| strpos($mailbox, $ns[0]) === 0
) {
return $type;