Commit a728c69
committed
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 preSubmit1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
| 386 | + | |
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| |||
0 commit comments