fix: nothing personal validator error with bad email value#723
Merged
kenjis merged 2 commits intocodeigniter4:developfrom May 2, 2023
GeorgKott:fix_nothing_personal_validator_error
Merged
fix: nothing personal validator error with bad email value#723kenjis merged 2 commits intocodeigniter4:developfrom GeorgKott:fix_nothing_personal_validator_error
kenjis merged 2 commits intocodeigniter4:developfrom
GeorgKott:fix_nothing_personal_validator_error
Conversation
datamweb
approved these changes
Apr 30, 2023
kenjis
reviewed
May 15, 2023
| $localPart, | ||
| $domain, | ||
| ] = explode('@', $email); | ||
| if (str_contains($email, '@')) { |
Member
There was a problem hiding this comment.
str_contains() requires PHP8. So using it here is a bug.
But we use polyfill-php80, so the test does not fail on PHP 7.4.
$ composer why symfony/polyfill-php80
friendsofphp/php-cs-fixer v3.16.0 requires symfony/polyfill-php80 (^1.27)
Member
There was a problem hiding this comment.
But it is a transitive dependency of a dev dependency, so using it here is still a bug.
Member
There was a problem hiding this comment.
Yes, it is a bug, but we cannot detect it by testing.
Why don't we require symfony/polyfill-php80?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
superseded: #712
Sorry for my previous pull request. I closed it because after applying the gpg addition, conflicts occurred in the code for earlier commits.
after that
And I thought it would be easier to create a new pull request than to resolve these conflicts.
I also added some tests (integration and unit) that describe the issue I faced.
If you don't apply the changes I made, I will get an error in the tests.
i think that a POST request can contain any data, not necessarily a valid email value. After all, it's not the front-end's responsibility to validate, but the back-end.
Thank you