Fix for /api/v1/get/mailbox/{email}

This commit is contained in:
jkellerer 2022-05-05 19:43:33 +02:00 committed by GitHub
parent 5613134fed
commit 187ddedf96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -989,11 +989,15 @@ if (isset($_GET['query'])) {
if (isset($_GET['tags']) && $_GET['tags'] != '')
$tags = explode(',', $_GET['tags']);
$mailboxes = mailbox('get', 'mailboxes', $object, $tags);
if (!empty($mailboxes)) {
foreach ($mailboxes as $mailbox) {
if ($details = mailbox('get', 'mailbox_details', $mailbox)) $data[] = $details;
else continue;
if ($tags === null) {
$data = mailbox('get', 'mailbox_details', $object);
} else {
$mailboxes = mailbox('get', 'mailboxes', $object, $tags);
if (is_array($mailboxes)) {
foreach ($mailboxes as $mailbox) {
if ($details = mailbox('get', 'mailbox_details', $mailbox))
$data[] = $details;
}
}
}
process_get_return($data);