summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include/rcube_imap.php
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-11-15 09:22:13 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-11-15 09:22:13 +0000
commit30bf14622afa32768ddd6e21d09ceb4c9ed092e5 (patch)
tree4f8c4aa56c0d2a4f6557ef47adcb9534682c30d2 /roundcubemail/program/include/rcube_imap.php
parent81bad447d14df1e6ba8b299739af48c79cbe9324 (diff)
- Fix commit r5424 + preformance microoptimizations
git-svn-id: https://svn.roundcube.net/trunk@5425 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_imap.php')
-rw-r--r--roundcubemail/program/include/rcube_imap.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php
index 4fe39e1ac..d56da3d26 100644
--- a/roundcubemail/program/include/rcube_imap.php
+++ b/roundcubemail/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;