From 1d2b0d9f9f2fc4ade8f1034068be05233bf6f208 Mon Sep 17 00:00:00 2001 From: Fernando Wentland Date: Mon, 27 May 2019 15:52:57 -0300 Subject: [PATCH] Always append uniqid to filename Avoids name collisions when called more than once in rapid succession. --- src/YiiMailer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/YiiMailer.php b/src/YiiMailer.php index bf61231..0b7f41d 100644 --- a/src/YiiMailer.php +++ b/src/YiiMailer.php @@ -577,7 +577,7 @@ public function send() */ public function save() { - $filename = date('YmdHis') . '_' . (empty($this->view) ? uniqid() : $this->view) . '.eml'; + $filename = date('YmdHis') . (!empty($this->view) ? '_' . $this->view : '') . '_' . uniqid() . '.eml'; $dir = Yii::getPathOfAlias($this->savePath); // Create a directory