Skip to content

Commit

Permalink
abort early when no paths are configured
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Jul 3, 2024
1 parent 9ad5912 commit 23c781f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ public function getPathInfo($path, $addTrailingSlash = true)
$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);
Expand Down

0 comments on commit 23c781f

Please sign in to comment.