fix: allow images to have .jpeg extension consistently

This commit is contained in:
Aonrud 2023-03-21 18:06:54 +00:00
commit ae5e12be3b
4 changed files with 13 additions and 10 deletions

View file

@ -90,7 +90,7 @@ class FS implements FileManagerInterface
helper('media');
$allPodcastImagesPaths = [];
foreach (['jpg', 'png', 'webp'] as $ext) {
foreach (['jpg', 'jpeg', 'png', 'webp'] as $ext) {
$images = glob(media_path("/podcasts/{$podcastHandle}/*_*{$ext}"));
if (! $images) {
@ -114,7 +114,7 @@ class FS implements FileManagerInterface
helper('media');
$allPersonsImagesPaths = [];
foreach (['jpg', 'png', 'webp'] as $ext) {
foreach (['jpg', 'jpeg', 'png', 'webp'] as $ext) {
$images = glob(media_path("/persons/*_*{$ext}"));
if (! $images) {

View file

@ -136,7 +136,10 @@ class S3 implements FileManagerInterface
$prefixedPodcasts = $this->prefixKey('podcasts');
array_push($keys, ...preg_grep("~^{$prefixedPodcasts}\/{$podcastHandle}\/.*_.*.\.(jpg|png|webp)$~", $key));
array_push(
$keys,
...preg_grep("~^{$prefixedPodcasts}\/{$podcastHandle}\/.*_.*.\.(jpe?g|png|webp)$~", $key)
);
}
$objectsToDelete = array_map(static function ($key): array {
@ -178,7 +181,7 @@ class S3 implements FileManagerInterface
$prefixedPersons = $this->prefixKey('persons');
array_push($keys, ...preg_grep("~^{$prefixedPersons}\/.*_.*.\.(jpg|png|webp)$~", $key));
array_push($keys, ...preg_grep("~^{$prefixedPersons}\/.*_.*.\.(jpe?g|png|webp)$~", $key));
}
$objectsToDelete = array_map(static function ($key): array {