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

fix. After matches is not set empty #1625

Merged
merged 1 commit into from
Jan 1, 2019
Merged

fix. After matches is not set empty #1625

merged 1 commit into from
Jan 1, 2019

Conversation

nyufeng
Copy link
Contributor

@nyufeng nyufeng commented Dec 25, 2018

Description
in next foreach
$this->filters['before'] = array_merge($this->filters['before'], $matches);
will be merge last $matches,
This may add the last "after" to this "before"

example:

In config:

	public $filters = [
		'admin' => [
			'before' => [
				'admin',
			],
			'after' =>[
				'admin',
			],
		],
		'owadmin' =>[
			'after' =>[
				'admin',
			],
		],
		'api' => [
			'before' => [
				'api/v1/*',
			]
		],
	];

$this->filters is:

Array
(
    [before] => Array
        (
            [0] => admin
            [1] => admin
            [2] => owadmin
        )

    [after] => Array
        (
            [0] => toolbar
            [1] => admin
            [2] => admin
            [3] => owadmin
        )

)

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@jim-parry jim-parry changed the title fix. After matches is ont set empty fix. After matches is not set empty Jan 1, 2019
@jim-parry jim-parry merged commit c70b1c6 into codeigniter4:develop Jan 1, 2019
@nyufeng nyufeng deleted the patch-1 branch January 15, 2019 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants