Skip to content

Commit

Permalink
Issue #339: Fixed decoding issue with mailbox folder names
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Krätzig committed Jun 1, 2019
1 parent 0181b20 commit 0fe61e6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/PhpImap/Mailbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -1061,11 +1061,13 @@ public function getMailboxes($search = "*") {
$arr = [];
if($t = imap_getmailboxes($this->getImapStream(), $this->imapPath, $search)) {
foreach($t as $item) {
// https:/barbushin/php-imap/issues/339
$name = $this->decodeStringFromUtf7ImapToUtf8($item->name);
$arr[] = [
"fullpath" => $item->name,
"fullpath" => $name,
"attributes" => $item->attributes,
"delimiter" => $item->delimiter,
"shortpath" => substr($item->name, strpos($item->name, '}') + 1),
"shortpath" => substr($name, strpos($name, '}') + 1),
];
}
}
Expand All @@ -1080,11 +1082,13 @@ public function getSubscribedMailboxes($search = "*") {
$arr = [];
if($t = imap_getsubscribed($this->getImapStream(), $this->imapPath, $search)) {
foreach($t as $item) {
// https:/barbushin/php-imap/issues/339
$name = $this->decodeStringFromUtf7ImapToUtf8($item->name);
$arr[] = [
"fullpath" => $item->name,
"fullpath" => $name,
"attributes" => $item->attributes,
"delimiter" => $item->delimiter,
"shortpath" => substr($item->name, strpos($item->name, '}') + 1),
"shortpath" => substr($name, strpos($name, '}') + 1),
];
}
}
Expand Down

0 comments on commit 0fe61e6

Please sign in to comment.