From b71e948cfd842d5938c3af7a782ae2820ae09c3c Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 13 Mar 2022 16:40:56 +0100 Subject: [PATCH] Dont put the full file body as filename (#478) --- src/MultipartStream.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MultipartStream.php b/src/MultipartStream.php index 97afd4ae..c2517228 100644 --- a/src/MultipartStream.php +++ b/src/MultipartStream.php @@ -89,7 +89,7 @@ private function addElement(AppendStream $stream, array $element): void if (empty($element['filename'])) { $uri = $element['contents']->getMetadata('uri'); - if ($uri && \is_string($uri) && \substr($uri, 0, 6) !== 'php://') { + if ($uri && \is_string($uri) && \substr($uri, 0, 6) !== 'php://' && \substr($uri, 0, 7) !== 'data://') { $element['filename'] = $uri; } }