Skip to content

fix(Filters): check both keys and values in InvalidChars arrays#10303

Open
gr8man wants to merge 5 commits into
codeigniter4:developfrom
gr8man:fix/invalid-chars-array-map
Open

fix(Filters): check both keys and values in InvalidChars arrays#10303
gr8man wants to merge 5 commits into
codeigniter4:developfrom
gr8man:fix/invalid-chars-array-map

Conversation

@gr8man

@gr8man gr8man commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a bug in the InvalidChars filter where array keys were not being validated.
Previously, checkControl() used array_map(), which only applied the callback to the array's values while ignoring the array's keys entirely. Due to this, any control characters or invalid UTF-8 sequences passed through array keys (e.g. $_POST['bad_key']) bypassed the filter.

@michalsn michalsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a changelog entry.

@michalsn michalsn added the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 12, 2026
@michalsn

Copy link
Copy Markdown
Member

@gr8man gr8man requested a review from michalsn June 13, 2026 18:16

@michalsn michalsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants