From 149af174e2f9495ce93fc1f958daf8a2d85c394f Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 21 Jun 2024 17:26:31 +0200 Subject: [PATCH] avoid collision of generated filenames --- src/SparkPostApiTransport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SparkPostApiTransport.php b/src/SparkPostApiTransport.php index ab1c58e..37673b1 100644 --- a/src/SparkPostApiTransport.php +++ b/src/SparkPostApiTransport.php @@ -414,7 +414,7 @@ protected function logMessageContent(Email $message, $results = []) // Generate filename $filter = new FileNameFilter(); $title = substr($filter->filter($subject), 0, 35); - $logName = date('Ymd_His') . '_' . $title; + $logName = date('Ymd_His') . '_' . bin2hex(random_bytes(2)) . '_' . $title; // Store attachments if any $attachments = $message->getAttachments();