mirror of
https://github.com/flarum/core.git
synced 2025-10-12 07:24:27 +02:00
Require unique route names (#2771)
This commit is contained in:
@@ -62,7 +62,7 @@ class Frontend implements ExtenderInterface
|
||||
|
||||
public function removeRoute(string $name)
|
||||
{
|
||||
$this->removedRoutes[] = compact('name');
|
||||
$this->removedRoutes[] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -159,8 +159,8 @@ class Frontend implements ExtenderInterface
|
||||
/** @var RouteHandlerFactory $factory */
|
||||
$factory = $container->make(RouteHandlerFactory::class);
|
||||
|
||||
foreach ($this->removedRoutes as $route) {
|
||||
$collection->removeRoute('GET', $route['name']);
|
||||
foreach ($this->removedRoutes as $routeName) {
|
||||
$collection->removeRoute($routeName);
|
||||
}
|
||||
|
||||
foreach ($this->routes as $route) {
|
||||
|
@@ -63,9 +63,9 @@ class Routes implements ExtenderInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function remove(string $method, string $name)
|
||||
public function remove(string $name)
|
||||
{
|
||||
$this->removedRoutes[] = compact('method', 'name');
|
||||
$this->removedRoutes[] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -82,8 +82,8 @@ class Routes implements ExtenderInterface
|
||||
/** @var RouteHandlerFactory $factory */
|
||||
$factory = $container->make(RouteHandlerFactory::class);
|
||||
|
||||
foreach ($this->removedRoutes as $route) {
|
||||
$collection->removeRoute($route['method'], $route['name']);
|
||||
foreach ($this->removedRoutes as $routeName) {
|
||||
$collection->removeRoute($routeName);
|
||||
}
|
||||
|
||||
foreach ($this->routes as $route) {
|
||||
|
Reference in New Issue
Block a user