Summary | Dovecot folders subscription |
Queue | IMP |
Queue Version | Git master |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | slusarz (at) horde (dot) org |
Requester | leandro.damascena (at) gmail (dot) com |
Created | 06/18/2010 (5495 days ago) |
Due | |
Updated | 06/28/2010 (5485 days ago) |
Assigned | |
Resolved | 06/28/2010 (5485 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | Yes |
State ⇒ Resolved
Bug #9102: Don't want to reindex array when adding INBOXhttp://git.horde.org/diff.php/imp/lib/Imap/Tree.php?rt=horde-git&r1=bf4719ffd4d666e00287a27dc1f42085a36ccb0e&r2=2bb369ac9c5e8261ff06eff0fa01eb7541a7d21b
Priority ⇒ 2. Medium
New Attachment: inbox_subs.diff
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ IMP
Summary ⇒ Dovecot folders subscription
Type ⇒ Bug
State ⇒ Unconfirmed
mailserver) and this produces a error in IMAP Tree Folders... Looking
at the source code I could find an error when the INBOX is
unsubscribed...
protected function _getList($showunsub) in imp/lib/Imap/Tree.php...
This function tests if result list doesn't contain INBOX and FORCE an
array to increment INBOX, however, this function use array_merge and
it produces an error when some folder has a numeric name (in my case
my folder is: 2009 or 2010)...
Looking at PHP documentation I saw
(http://php.net/manual/en/function.array-merge.php):
If all of the arrays contain only numeric keys, the resulting array is
given incrementing keys starting from zero.
If you want to append array elements from the second array to the
first array while not overwriting the elements from the first array
and not re-indexing, use the + array union operator:
<?php
$array1 = array(0 => 'zero_a', 2 => 'two_a', 3 => 'three_a');
$array2 = array(1 => 'one_b', 3 => 'three_b', 4 => 'four_b');
$result = $array1 + $array2;
var_dump($result);
?>