Problem/Motivation

When performing in_array() comparisons on strings, especially in security/access components - we should pass TRUE to the third parameter of in_array() to ensure a strict (===) comparison.

Proposed resolution

Do it.

Remaining tasks

Review

User interface changes

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Status: Active » Needs review
FileSize
1.14 KB
chx’s picture

Status: Needs review » Reviewed & tested by the community

While the chances of calling a field "0" is not high... let's not open that door.

Berdir’s picture

Yeah, field names are *supposed* to be lowercase, but we only validate that for configurable fields at the moment.

I doubt it would work to have a field named Bla and one bla, so doesn't make much difference practically, but fine with me ;)

Wim Leers’s picture

Could you please delay committing this patch until #2287071: Add cacheability metadata to access checks is committed? That ~300K patch is very, very painful to reroll and this one will conflict. Sorry, and thanks for your consideration. I will help with rerolling this patch if you like.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll
er.pushpinderrana’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
1.18 KB

Rerolled #1 patch.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

  • alexpott committed e07bf5f on 8.0.x
    Issue #2337227 by er.pushpinderrana, larowlan: Fixed...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed e07bf5f and pushed to 8.0.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.