Skip to content

Commit

Permalink
Merge pull request #5627 from kenjis/fix-router-filter
Browse files Browse the repository at this point in the history
refactor: small changes in Filters and Router
  • Loading branch information
kenjis authored Jan 29, 2022
2 parents 367b805 + 0c99664 commit bafd425
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion system/Filters/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ protected function processAliasesToClass(string $position)
// when using enableFilter() we already write the class name in ->filtersClass as well as the
// alias in ->filters. This leads to duplicates when using route filters.
// Since some filters like rate limiters rely on being executed once a request we filter em here.
$this->filtersClass[$position] = array_unique($this->filtersClass[$position]);
$this->filtersClass[$position] = array_values(array_unique($this->filtersClass[$position]));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion system/Router/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ public function handle(?string $uri = null)
$uri = urldecode($uri);

// Restart filterInfo
$this->filterInfo = null;
$this->filterInfo = null;
$this->filtersInfo = [];

if ($this->checkRoutes($uri)) {
if ($this->collection->isFiltered($this->matchedRoute[0])) {
Expand Down

0 comments on commit bafd425

Please sign in to comment.