From 23c781f85545290f48523edc181e4b8d2c220c89 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 3 Jul 2024 16:03:30 +0200 Subject: [PATCH] abort early when no paths are configured --- Path.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Path.php b/Path.php index de2f757..0fbb066 100644 --- a/Path.php +++ b/Path.php @@ -81,6 +81,10 @@ class Path $path = static::cleanPath($path, $addTrailingSlash); $paths = $this->paths; + if ($paths === []) { + throw new \Exception('No paths configured'); + } + $allowed = array_keys($paths); usort($allowed, static fn($a, $b) => strlen($a) - strlen($b)); $allowed = array_map('preg_quote_cb', $allowed);