Skip to content

Commit

Permalink
Always append uniqid to filename
Browse files Browse the repository at this point in the history
Avoids name collisions when called more than once in rapid succession.
  • Loading branch information
ferow2k authored May 27, 2019
1 parent 9e0a4c1 commit 1d2b0d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/YiiMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d2b0d9

Please sign in to comment.