Skip to content

Commit

Permalink
Bug #11783: Don't re-convert mailboxes already converted to UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Nov 30, 2012
1 parent 84345bc commit 8e6cc32
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions imp/lib/LoginTasks/SystemTask/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -524,16 +524,18 @@ protected function _upgradeMailboxPrefs()

foreach ($special_mboxes as $val) {
if (!$prefs->isDefault($val)) {
$old_pref = IMP_Mailbox::getPref($val);
$mbox = IMP_Mailbox::get(Horde_String::convertCharset(strval($old_pref), 'UTF7-IMAP', 'UTF-8'));
$prefs->setValue($val, $mbox->pref_to);
$old_pref = strval(IMP_Mailbox::getPref($val));
if (!Horde_Mime::is8bit($old_pref, 'UTF-8')) {
$mbox = IMP_Mailbox::get(Horde_String::convertCharset($old_pref, 'UTF7-IMAP', 'UTF-8'));
$prefs->setValue($val, $old_pref->$mbox->pref_to);
}
}
}

$imp_identity = $injector->getInstance('IMP_Identity');

foreach ($imp_identity->getAll('sent_mail_folder') as $key => $val) {
if (!is_null($val)) {
if (!is_null($val) && !Horde_Mime::is8bit($val, 'UTF-8')) {
$mbox = IMP_Mailbox::get(Horde_String::convertCharset(strval($val), 'UTF7-IMAP', 'UTF-8'));
$imp_identity->setValue('sent_mail_folder', $mbox, $key);
}
Expand Down

0 comments on commit 8e6cc32

Please sign in to comment.