abort early when no paths are configured

This commit is contained in:
Andreas Gohr
2024-07-03 16:03:30 +02:00
parent 9ad5912307
commit 23c781f855

View File

@@ -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);