Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298117

Clean up code in UserRolesCacheContext::getContext()

$
0
0

Problem/Motivation

In #3436395-37: UserRolesCacheContext can lead to poisoned cache returns for user 1, @alexpott wrote,

FWIW it would great to file a follow up to add a TRUE to the in_array in this code.

referring to this line:

      return (in_array($role, $this->user->getRoles()) ? 'true' : 'false');

I am sure that at least one core committer will say that the else after a return should be removed.

Proposed resolution

Clean up the code.

Remaining tasks

User interface changes

None

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

N/A


Viewing all articles
Browse latest Browse all 298117

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>