From a550278f396b4914c3718fbec503cceff66d0e29 Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Mon, 7 Mar 2022 22:19:57 +0100 Subject: [PATCH] Fix name with spaces --- app/Repositories/Core/Medias.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Repositories/Core/Medias.php b/app/Repositories/Core/Medias.php index ee02c0fb..94649da0 100644 --- a/app/Repositories/Core/Medias.php +++ b/app/Repositories/Core/Medias.php @@ -80,6 +80,7 @@ class Medias return null; } $id = $image['id']; + $image['name'] = str_replace(['#', '/', '\\', ' '], '-', $image['name']); $filename = $image['name'] . self::getExtension($image['file_name']); return "/storage/$id/$filename"; @@ -91,6 +92,7 @@ class Medias return null; } $id = $image['id']; + $image['name'] = str_replace(['#', '/', '\\', ' '], '-', $image['name']); $filename = $image['name'] . '-thumb' . self::getExtension($image['file_name']); return "/storage/$id/conversions/$filename"; @@ -102,6 +104,7 @@ class Medias return null; } $id = $image['id']; + $image['name'] = str_replace(['#', '/', '\\', ' '], '-', $image['name']); $filename = $image['name'] . '-preview' . self::getExtension($image['file_name']); return "/storage/$id/conversions/$filename";