Skip to content

Commit

Permalink
handle for whatever reason upload file input named "name"
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jul 21, 2018
1 parent f5574aa commit 4795662
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions spec/Handler/Writer/MailSpec.php
Expand Up @@ -59,6 +59,17 @@
'type' => 'text/html'
],
],
"file-collection2" => [
"name" => [
[
'name' => 'foo.html',
'tmp_name' => __DIR__ . '/../../Fixture/data/foo.html',
'error' => 0,
'size' => 1,
'type' => 'text/html'
]
],
],
],
'cookie_data' => [],
]
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/Writer/Mail.php
Expand Up @@ -93,7 +93,7 @@ private function singleBodyAddPart(MimeMessage $body, array $data) : MimeMessage
private function bodyAddPart(MimeMessage $body, array $data) : MimeMessage
{
foreach ($data as $upload) {
if (\key($upload) === 'name') {
if (\key($upload) === 'name' && ! is_array($upload['name'])) {
$body = $this->singleBodyAddPart($body, $upload);
continue;
}
Expand Down

0 comments on commit 4795662

Please sign in to comment.