-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Fix allow loose
as an email validation mode
#60705
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
base: 6.4
Are you sure you want to change the base?
Conversation
Can you also add |
Actually, I think the array_merge should be dropped (putting
|
@@ -272,5 +272,6 @@ public static function emailValidationModeProvider() | |||
foreach (Email::VALIDATION_MODES as $mode) { | |||
yield [$mode]; | |||
} | |||
yield ['loose']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this. Based on my follow-up commit, loose
is already part of Email::VALIDATION_MODES
in the 6.4 branch.
@@ -1067,7 +1067,7 @@ private function addValidationSection(ArrayNodeDefinition $rootNode, callable $e | |||
->validate()->castToArray()->end() | |||
->end() | |||
->scalarNode('translation_domain')->defaultValue('validators')->end() | |||
->enumNode('email_validation_mode')->values((class_exists(Email::class) ? Email::VALIDATION_MODES : ['html5-allow-no-tld', 'html5', 'strict']) + ['loose'])->end() | |||
->enumNode('email_validation_mode')->values(array_merge(class_exists(Email::class) ? Email::VALIDATION_MODES : ['html5-allow-no-tld', 'html5', 'strict'], ['loose']))->end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->enumNode('email_validation_mode')->values(array_merge(class_exists(Email::class) ? Email::VALIDATION_MODES : ['html5-allow-no-tld', 'html5', 'strict'], ['loose']))->end() | |
->enumNode('email_validation_mode')->values(class_exists(Email::class) ? Email::VALIDATION_MODES : ['html5-allow-no-tld', 'html5', 'strict', 'loose'])->end() |
Prior to the change in #60365, the validation of this config option explicitly included With the suggested change, projects that were using the previously allowed If you prefer to make this explicitly invalid because it is not supported, I understand that decision but wouldn't be able to contribute that on this PR as I don't have the context around any other consequences. |
ah, I missed that we forgot to change the FrameworkBundle config in 7.0, and that some projects not using the constraint might have an invalid config. So yes, keep |
loose
as an email validation mode
Thanks, I've opened #60706 for that follow up change. |
After upgrading to Symfony 7.2.7 we observe this error:
Our configuration is:
From
bin/console config:dump-reference framework
we observe:After this change, the above error no longer occurs and expected allowed values are observed:
See #60373 and #60365 where the previous code was introduced.