mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Resolve Issue #70
This commit is contained in:
parent
52dadc46f3
commit
801e3f8e2b
1 changed files with 17 additions and 6 deletions
|
|
@ -100,16 +100,27 @@ class ResponseCollection extends \MailSo\Base\Collection
|
||||||
|
|
||||||
foreach ($this as $oResponse) {
|
foreach ($this as $oResponse) {
|
||||||
if (\MailSo\Imap\Enumerations\ResponseType::UNTAGGED === $oResponse->ResponseType &&
|
if (\MailSo\Imap\Enumerations\ResponseType::UNTAGGED === $oResponse->ResponseType &&
|
||||||
$sStatus === $oResponse->StatusOrIndex && 5 === count($oResponse->ResponseList))
|
$sStatus === $oResponse->StatusOrIndex && 5 <= count($oResponse->ResponseList))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$sFullNameRaw = $oResponse->ResponseList[4];
|
/**
|
||||||
if (\is_array($sFullNameRaw)) {
|
* A bug in the parser converts folder names that start with '[' into arrays,
|
||||||
$sFullNameRaw = "[{$sFullNameRaw[0]}]";
|
* and subfolders are in $oResponse->ResponseList[5+]
|
||||||
|
* https://github.com/the-djmaze/snappymail/issues/1
|
||||||
|
* https://github.com/the-djmaze/snappymail/issues/70
|
||||||
|
*/
|
||||||
|
$sFullNameRaw = \array_slice($oResponse->ResponseList, 4);
|
||||||
|
foreach ($sFullNameRaw as &$name) {
|
||||||
|
if (\is_array($name)) {
|
||||||
|
$name = "[{$name[0]}]";
|
||||||
|
} else if (!\is_string($name)) {
|
||||||
|
$name = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!\is_string($sFullNameRaw)) {
|
$sFullNameRaw = \implode('', $sFullNameRaw);
|
||||||
\error_log('ResponseCollection::getFoldersResult: invalid string ' . \var_export($sFullNameRaw, true));
|
if (!\strlen($sFullNameRaw)) {
|
||||||
|
\error_log('ResponseCollection::getFoldersResult: invalid string ' . \var_export($oResponse->ResponseList[4], true));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$oFolder = new Folder($sFullNameRaw,
|
$oFolder = new Folder($sFullNameRaw,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue