From e1a7630ceede4357b2cfc3c0b648e0a3bd245530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B8nstantine=20Kovalensky?= <45331093+kovalensky@users.noreply.github.com> Date: Thu, 9 Nov 2023 19:54:53 +0400 Subject: [PATCH] Use more reliable original file names for attachments (#1070) --- src/Legacy/Attach.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Legacy/Attach.php b/src/Legacy/Attach.php index b165a3173..6e817000e 100644 --- a/src/Legacy/Attach.php +++ b/src/Legacy/Attach.php @@ -847,7 +847,7 @@ class Attach $this->attach_filename = preg_replace('#([\xC2\xC3])([\x80-\xBF])#', 'chr(ord(\'$1\')<<6&0xC0|ord(\'$2\')&0x3F)', $this->attach_filename); $this->attach_filename = rawurlencode($this->attach_filename); $this->attach_filename = preg_replace("/(%[0-9A-F]{1,2})/i", '', $this->attach_filename); - $this->attach_filename = trim($this->attach_filename . time()); + $this->attach_filename = trim($this->attach_filename . '_' .make_rand_str(13)); } $this->attach_filename = str_replace(['&', '&', ' '], '_', $this->attach_filename); $this->attach_filename = str_replace('php', '_php_', $this->attach_filename);