You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #12072 Remove strict true === $user['showEmail'] on preSubmit (jbdelhommeau)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes#12072).
Discussion
----------
Remove strict true === $user['showEmail'] on preSubmit
<!--
If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/roadmap for the list of maintained branches).
If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `master` for features of unreleased versions).
-->
On the pre submit example. Strict condition will be used. `true === $user['showEmail']`.
In pre submit value of data are not normalized. Strict operator `true === $user['showEmail']` is wrong.
If we want used strict operator we can use: `'1' === $user['showEmail']`. but in case of checkbox is not checked the key `showEmail` is not set.
I prefere use this condition: `isset($user['showEmail']) && $user['showEmail']` or maybe `false === empty($user['showEmail'])` ?
Commits
-------
122ccaa Remove strict true === $user['showEmail'] on preSubmit
0 commit comments