diff --git a/app/Controllers/FileInfoController.php b/app/Controllers/FileInfoController.php index 38c3a9f..b64566d 100644 --- a/app/Controllers/FileInfoController.php +++ b/app/Controllers/FileInfoController.php @@ -29,11 +29,12 @@ class FileInfoController */ public function __invoke(Response $response, string $path = '.') { - if (! is_file($path)) { + $file = new SplFileInfo($path); + + if (! $file->isFile()) { return $response->withStatus(404, 'File not found'); } - $file = new SplFileInfo($path); if ($file->getSize() >= $this->config->get('app.max_hash_size', 1000000000)) { return $response->withStatus(500, 'File size too large'); }