Fix: Fetch compressor only once

This commit is contained in:
philipp lang 2021-09-20 00:29:21 +02:00
parent 328e3784c1
commit f38a63e1f2
1 changed files with 3 additions and 1 deletions

View File

@ -89,8 +89,10 @@ class MediaPath
{ {
$return = collect([]); $return = collect([]);
$extensionRegex = $this->compressor()->getExtensionRegex();
foreach (Storage::files($this->versionsDirPath()) as $file) { 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; continue;
} }