You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Filters::processFilters methods replaces internally filter expressions with wrong regular expressions.
CodeIgniter 4 version
CodeIgniter4 Beta 0.0.1
Affected module(s)
Filters
Expected behaviour, and steps to reproduce if appropriate
Assume the following filter statement in Config/Filters.php:
public $filters = ['login' => ['before' => ['company/*']]];
This filter setting should set a filter for controller Company. Unfortunately, due to the wrong filter processing also controllers like CompanyXYZ will have the filter applied.
The reason for this wrong behaviour is that - for example - 'company/' is replaced by the regular expression 'company.+' which is basically equivalent with 'company'. But this is not correct.
The two statements responsible for the replacement are:
Describe the bug
Filters::processFilters methods replaces internally filter expressions with wrong regular expressions.
CodeIgniter 4 version
CodeIgniter4 Beta 0.0.1
Affected module(s)
Filters
Expected behaviour, and steps to reproduce if appropriate
Assume the following filter statement in Config/Filters.php:
This filter setting should set a filter for controller Company. Unfortunately, due to the wrong filter processing also controllers like CompanyXYZ will have the filter applied.
The reason for this wrong behaviour is that - for example - 'company/' is replaced by the regular expression 'company.+' which is basically equivalent with 'company'. But this is not correct.
The two statements responsible for the replacement are:
I do not know why
str_replace('/*', '*', $path)
is required?! At least in my example this is the root for the problems.The text was updated successfully, but these errors were encountered: