diff --git a/src/Embedder/AttachmentEmbedder.php b/src/Embedder/AttachmentEmbedder.php index eed0958..e1f50cc 100755 --- a/src/Embedder/AttachmentEmbedder.php +++ b/src/Embedder/AttachmentEmbedder.php @@ -95,8 +95,12 @@ public function fromRemoteUrl($url) if ($httpcode == 200) { $pathInfo = pathinfo($url); + $queryStr = parse_url($url, PHP_URL_QUERY); + parse_str($queryStr, $queryParams); + $basename = $queryParams['basename'] ?? $pathInfo['basename']; + return $this->embed( - new Swift_Image($raw, "{$pathInfo['basename']}", $contentType) + new Swift_Image($raw, "{$basename}", $contentType) ); } }