Skip to content

Commit

Permalink
Merge pull request #383 from jonasdekeukelaere/518-usertemplate-uniqu…
Browse files Browse the repository at this point in the history
…e-filename-images

Add time to user template images to make unique filesnames
  • Loading branch information
tijsverkoyen authored Aug 22, 2024
2 parents ba63e07 + f64d1f7 commit 3405a9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Backend/Modules/Pages/Ajax/UploadFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private function writeFile(string $content, string $fileName, string $destinatio
}

// convert the filename to url friendly version
$baseName = Uri::getUrl(pathinfo($fileName, PATHINFO_FILENAME));
$baseName = Uri::getUrl(pathinfo($fileName, PATHINFO_FILENAME)) . '_' . time();
$extension = pathinfo($fileName, PATHINFO_EXTENSION);
if (!in_array(strtolower($extension), self::ALLOWED_EXTENSIONS)) {
throw new Exception('This is not an image.');
Expand Down

0 comments on commit 3405a9f

Please sign in to comment.