Skip to content

Bug: Filter wildcards ignore default methods #2455

Description

@MGatner

Describe the bug
Filters applied via app/Config/Filters.php $filters do a literal check versus the URL, which doesn't take into account default controller methods when resolving wildcards. This makes for confusing behavior - consider the following:

public $filters = ['login' => ['before' => ['account/*']]];

A workaround is to specify the wildcard like account* but that also possibly matches other Controllers (like accountants/index).

CodeIgniter 4 version
Latest develop

Affected module(s)
Filters, Routes

Expected behavior, and steps to reproduce if appropriate
I think a simple inclusion of {whatever}/ in * expansion should work.

Context

  • OS: Linux
  • Web server Apache
  • PHP version 7.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugVerified issues on the current code behavior or pull requests that will fix them

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions