From b27eb3f233cf802b1f2620fdfc34b4b13926c6d7 Mon Sep 17 00:00:00 2001 From: Alain Martini Date: Mon, 4 Mar 2024 10:34:47 +0100 Subject: [PATCH] fixes too loose condition that cause to wipe out all generated responsive images if they are in the same output directory (#3558) --- src/MediaCollections/Filesystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MediaCollections/Filesystem.php b/src/MediaCollections/Filesystem.php index dc0427186..c2cc1ec61 100644 --- a/src/MediaCollections/Filesystem.php +++ b/src/MediaCollections/Filesystem.php @@ -242,7 +242,7 @@ public function removeResponsiveImages(Media $media, string $conversionName = 'm $responsiveImagePaths = array_filter( $allFilePaths, - fn (string $path) => Str::contains($path, $conversionName) + fn (string $path) => Str::contains($path, $media->name) && Str::contains($path, $conversionName) ); $this->filesystem->disk($media->disk)->delete($responsiveImagePaths);