Closed (fixed)
Project:
Drupal core
Version:
9.3.x-dev
Component:
Claro theme
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Nov 2021 at 23:28 UTC
Updated:
8 Feb 2022 at 09:19 UTC
Jump to comment: Most recent
Comments
Comment #3
nickdickinsonwildeIf it doesn't need a test (I think this doesn't) then ready for review.
Comment #4
dqdI don't know why we do not use strict comparison for in_array checks using claro_preprocess_form_element__password() (anyone?), but after reviewing these 2 small code additions (2x , TRUE added), no code removals, and after testing local on latest 9.3.x dev Drupal core and on Tugboat with Claro set as default theme and using the project code of the project the OT worked on while detecting this behaviour, I can confirm that the patch provides the intended strict comparsion without breaking anything and the Drupal installation operates as expected without any flaws.
One last question, is the previous implementation the default, or does "Seven" admin theme behave different here? RTBC from me. But I would tend to say it needs one more review.
Comment #5
nickdickinsonwildeThanks diqidoq
Re that last question: That is the only implementation of that preprocess hook (in core).
Comment #6
dqdOk. So there is no "similar" issue possible in Seven etc. GTK...
To quote https://www.php.net/manual/de/function.in-array.php#106319:
Loose checking returns some crazy, counter-intuitive results when used with certain arrays. It is completely correct behaviour, due to PHP's leniency on variable types, but in "real-life" is almost useless. The solution is to use the strict checking option.So - I would like to RTBC to speed things up, but I'll ping a maintainer to make sure it gets another eye on it.
Comment #8
bnjmnmCommitted 4cbbdb2 and pushed to 9.4.x. Thanks!
This doesn't need test coverage as doing so would effectively be testing PHP.
Running this PHP snippet demonstrates how
in_array()can lead to unexpected positives when strict checking isn't enabled.Leaving at RTBC and switching version to 9.3.x for potential backport after the code freeze.
Comment #9
lauriiiI think this issue is good for backport because it seems low risk.
Comment #10
catch+1 backporting this.
Comment #11
dqd+1 backporting this.
Comment #14
lauriiiWent ahead with the backport since this seems like a low-risk change and Claro is experimental.