Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: small changes in Filters and Router #5627

Merged
merged 2 commits into from
Jan 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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