mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 11:26:13 +00:00
Mvc/Router - normalize multiple slashes in paths, fix regression in 61c9d2f5b1
Although zero (0) is hardly used in url's, when it is used, the function should not suppress it. Fix this by using a closure in array_filter() which only filters empty strings. ref: https://www.reddit.com/r/opnsense/comments/1hghfzv/health_reporting_rrd_graphs_stopped_working_with/
This commit is contained in:
parent
24485709f3
commit
6145b7f0d0
@ -165,7 +165,10 @@ class Router
|
||||
*/
|
||||
private function parsePath(string $path, array $defaults): array
|
||||
{
|
||||
$pathElements = array_values(array_filter(explode("/", $path)));
|
||||
$empty_filter = function($value) {
|
||||
return $value !== '';
|
||||
};
|
||||
$pathElements = array_values(array_filter(explode("/", $path), $empty_filter));
|
||||
|
||||
$result = [
|
||||
"namespace" => null,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user