diff --git a/lib/MediaPath.php b/lib/MediaPath.php index 1d5b37e..5c29301 100644 --- a/lib/MediaPath.php +++ b/lib/MediaPath.php @@ -89,8 +89,10 @@ class MediaPath { $return = collect([]); + $extensionRegex = $this->compressor()->getExtensionRegex(); + foreach (Storage::files($this->versionsDirPath()) as $file) { - if (!preg_match_all('|('.preg_quote($this->filename(), '|').')(-[0-9]+x[0-9]+)?(\.'.$this->compressor()->getExtensionRegex().'+)$|', $file, $matches)) { + if (!preg_match_all('|('.preg_quote($this->filename(), '|').')(-[0-9]+x[0-9]+)?(\.'.$extensionRegex.'+)$|', $file, $matches)) { continue; }