diff --git a/src/Entity/ImageRequest.php b/src/Entity/ImageRequest.php index 5ca739a..d603df0 100644 --- a/src/Entity/ImageRequest.php +++ b/src/Entity/ImageRequest.php @@ -107,15 +107,16 @@ public function getSourceFileAbsolutePath(): ?string $return = null; if (is_dir($absoluteFileDirPath) === true) { foreach ((new \DirectoryIterator($absoluteFileDirPath)) as $item) { - assert($item instanceof \DirectoryIterator); if (in_array($item->getFilename(), ['.', '..'], true)) { continue; } + $realPath = $item->getRealPath(); + assert(is_string($realPath)); if ( ($return === null || $item->getExtension() === $this->extension) - && pathinfo($item->getRealPath())['filename'] === $this->basename + && pathinfo($realPath)['filename'] === $this->basename ) { - $return = $item->getRealPath(); + $return = $realPath; } } }