Skip to content

Commit

Permalink
Fixed attachment name encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
willbrowningme committed Nov 28, 2019
1 parent fa44ace commit f92f5d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/EmailData.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public function __construct(Parser $parser)
foreach ($parser->getAttachments() as $attachment) {
$this->attachments[] = [
'stream' => base64_encode(stream_get_contents($attachment->getStream())),
'file_name' => $attachment->getFileName(),
'mime' => $attachment->getContentType()
'file_name' => base64_encode($attachment->getFileName()),
'mime' => base64_encode($attachment->getContentType())
];
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/Mail/ForwardEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public function build()
foreach ($this->emailAttachments as $attachment) {
$email->attachData(
base64_decode($attachment['stream']),
$attachment['file_name'],
['mime' => $attachment['mime']]
base64_decode($attachment['file_name']),
['mime' => base64_decode($attachment['mime'])]
);
}

Expand Down
4 changes: 2 additions & 2 deletions app/Mail/ReplyToEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public function build()
foreach ($this->emailAttachments as $attachment) {
$email->attachData(
base64_decode($attachment['stream']),
$attachment['file_name'],
['mime' => $attachment['mime']]
base64_decode($attachment['file_name']),
['mime' => base64_decode($attachment['mime'])]
);
}

Expand Down

0 comments on commit f92f5d7

Please sign in to comment.