abort early when no paths are configured
This commit is contained in:
4
Path.php
4
Path.php
@@ -81,6 +81,10 @@ class Path
|
|||||||
$path = static::cleanPath($path, $addTrailingSlash);
|
$path = static::cleanPath($path, $addTrailingSlash);
|
||||||
|
|
||||||
$paths = $this->paths;
|
$paths = $this->paths;
|
||||||
|
if ($paths === []) {
|
||||||
|
throw new \Exception('No paths configured');
|
||||||
|
}
|
||||||
|
|
||||||
$allowed = array_keys($paths);
|
$allowed = array_keys($paths);
|
||||||
usort($allowed, static fn($a, $b) => strlen($a) - strlen($b));
|
usort($allowed, static fn($a, $b) => strlen($a) - strlen($b));
|
||||||
$allowed = array_map('preg_quote_cb', $allowed);
|
$allowed = array_map('preg_quote_cb', $allowed);
|
||||||
|
|||||||
Reference in New Issue
Block a user