Skip to content

Commit 0f036a6

Browse files
committed
fix: module filters are not discovered when you use module route with filters
Fixes #4720
1 parent 4995720 commit 0f036a6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

system/CodeIgniter.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,14 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache
358358
{
359359
$routeFilter = $this->tryToRouteIt($routes);
360360

361+
$uri = $this->determinePath();
362+
361363
// Start up the filters
362364
$filters = Services::filters();
363365

366+
// Discover filters
367+
$filters->initialize(strtolower($uri));
368+
364369
// If any filters were specified within the routes file,
365370
// we need to ensure it's active for the current request
366371
if ($routeFilter !== null) {
@@ -375,8 +380,6 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache
375380
}
376381
}
377382

378-
$uri = $this->determinePath();
379-
380383
// Never run filters when running through Spark cli
381384
if (! defined('SPARKED')) {
382385
// Run "before" filters

0 commit comments

Comments
 (0)