Skip to content

Commit

Permalink
variable name fix
Browse files Browse the repository at this point in the history
  • Loading branch information
unisender-dev authored Jan 28, 2020
1 parent ed4378c commit e405cb3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Transport/UniOneApiTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ private function getEndpoint(): string

private function getAttachmentFilename(DataPart $attachment, Headers $headers): ?string
{
preg_match('/name[^;\n=]*=(([\'"]).*?\2|[^;\n]*)/', $headers->get('Content-Type')->getBodyAsString(), $mathes);
preg_match('/name[^;\n=]*=(([\'"]).*?\2|[^;\n]*)/', $headers->get('Content-Type')->getBodyAsString(), $matches);

if (isset($mathes[0])) {
if (isset($matches[0])) {
if ('inline' === $headers->getHeaderBody('Content-Disposition')) {
return str_replace('name=', '', $mathes[0]);
return str_replace('name=', '', $matches[0]);
} else {
return str_replace('name=', '', sprintf('%s.%s', $mathes[0] , $attachment->getMediaSubtype()));
return str_replace('name=', '', sprintf('%s.%s', $matches[0] , $attachment->getMediaSubtype()));
}
}

Expand Down

0 comments on commit e405cb3

Please sign in to comment.