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: filter_var usage #4390

Merged
merged 2 commits into from
Mar 10, 2021
Merged

Fix: filter_var usage #4390

merged 2 commits into from
Mar 10, 2021

Conversation

iRedds
Copy link
Collaborator

@iRedds iRedds commented Mar 5, 2021

Description
When using the flag parameter in the filter_var function, the default value was incorrectly passed.
By default, null is passed, but an array or integer is expected.
Soft type casting may mask future problems.

Changes:

  • Updated variable types in docBlock
  • Added nullable type for filter parameter
  • Defined a default value for the filter and flag arguments if passed null.
  • The filter and flag arguments are cast to the expected types.
  • Adjusted the data validation condition based on the changes above.

Checklist:

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

system/HTTP/IncomingRequest.php Show resolved Hide resolved
system/HTTP/RequestTrait.php Show resolved Hide resolved
@paulbalandan
Copy link
Member

Please rebase.

@iRedds
Copy link
Collaborator Author

iRedds commented Mar 8, 2021

@paulbalandan Looks like I did something wrong.

@paulbalandan
Copy link
Member

I'm not sure how to fix this but I guess you need to cherry pick your PR commit adfa1ec

@totoprayogo1916
Copy link
Contributor

just run this @iRedds

git fetch upstream
git rebase upstream/develop

after that, become like this:
image

then run git push -f

FYI: I have test with your branch

@iRedds
Copy link
Collaborator Author

iRedds commented Mar 8, 2021

I think I did it.
Thx @totoprayogo1916

system/HTTP/IncomingRequest.php Outdated Show resolved Hide resolved
system/HTTP/RequestTrait.php Outdated Show resolved Hide resolved
@paulbalandan paulbalandan merged commit 7c1554c into codeigniter4:develop Mar 10, 2021
@iRedds iRedds deleted the fix/filter_var-usage branch March 10, 2021 16:51
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.

4 participants