diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-12-12 17:27:03 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-12-16 12:11:39 +0300 |
commit | 59797e9ce4166c6ff65a49675d6fbf59327d2ce1 (patch) | |
tree | d20e8430d00f9aff11fb456f821c5f2da973b9fb /lib | |
parent | 12b87bf146e874725013d9c2f133550c740ca2aa (diff) |
Treat MIME part IDs as strings, not ints
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Attachment.php | 2 | ||||
-rwxr-xr-x | lib/Controller/MessagesController.php | 6 | ||||
-rw-r--r-- | lib/Mailbox.php | 4 | ||||
-rw-r--r-- | lib/Model/IMAPMessage.php | 2 | ||||
-rw-r--r-- | lib/Service/IMailBox.php | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/lib/Attachment.php b/lib/Attachment.php index 7b5760c95..d80a46f3e 100644 --- a/lib/Attachment.php +++ b/lib/Attachment.php @@ -33,7 +33,7 @@ class Attachment { * @param \Horde_Imap_Client_Socket $conn * @param \Horde_Imap_Client_Mailbox $mailBox * @param int $messageId - * @param int $attachmentId + * @param string $attachmentId */ public function __construct($conn, $mailBox, $messageId, $attachmentId) { $this->conn = $conn; diff --git a/lib/Controller/MessagesController.php b/lib/Controller/MessagesController.php index 2e949df28..d4ca2c4a6 100755 --- a/lib/Controller/MessagesController.php +++ b/lib/Controller/MessagesController.php @@ -278,7 +278,7 @@ class MessagesController extends Controller { * @return AttachmentDownloadResponse */ public function downloadAttachment(int $accountId, string $folderId, int $messageId, - int $attachmentId) { + string $attachmentId) { $mailBox = $this->getFolder($accountId, $folderId); $attachment = $mailBox->getAttachment($messageId, $attachmentId); @@ -300,10 +300,10 @@ class MessagesController extends Controller { * @return JSONResponse */ public function saveAttachment(int $accountId, string $folderId, int $messageId, - int $attachmentId, string $targetPath) { + string $attachmentId, string $targetPath) { $mailBox = $this->getFolder($accountId, $folderId); - if ($attachmentId === 0) { + if ($attachmentId === '0') { // Save all attachments /* @var $m IMAPMessage */ $m = $mailBox->getMessage($messageId); diff --git a/lib/Mailbox.php b/lib/Mailbox.php index c213a4f1c..4fad6cc87 100644 --- a/lib/Mailbox.php +++ b/lib/Mailbox.php @@ -295,10 +295,10 @@ class Mailbox implements IMailBox { /** * @param int $messageId - * @param int $attachmentId + * @param string $attachmentId * @return Attachment */ - public function getAttachment(int $messageId, int $attachmentId): Attachment { + public function getAttachment(int $messageId, string $attachmentId): Attachment { return new Attachment($this->conn, $this->mailBox, $messageId, $attachmentId); } diff --git a/lib/Model/IMAPMessage.php b/lib/Model/IMAPMessage.php index 305814d7f..506fe526f 100644 --- a/lib/Model/IMAPMessage.php +++ b/lib/Model/IMAPMessage.php @@ -342,7 +342,7 @@ class IMAPMessage implements IMessage, JsonSerializable { return; } $this->attachments[] = [ - 'id' => (int) $p->getMimeId(), + 'id' => $p->getMimeId(), 'messageId' => $this->messageId, 'fileName' => $filename, 'mime' => $p->getType(), diff --git a/lib/Service/IMailBox.php b/lib/Service/IMailBox.php index 43ad3eb20..012a78958 100644 --- a/lib/Service/IMailBox.php +++ b/lib/Service/IMailBox.php @@ -49,10 +49,10 @@ interface IMailBox { /** * @param int $messageId - * @param int $attachmentId + * @param string $attachmentId * @return Attachment */ - public function getAttachment(int $messageId, int $attachmentId): Attachment; + public function getAttachment(int $messageId, string $attachmentId): Attachment; /** * @param int $messageId |