Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is a follow up on #710682: Allow re-loading object on entity_metadata_wrapper()
If a user object is passed to entity_metadata_wrapper() we make sure to re-load it. I think this can also help solving security issues, if a user is passing the global $user, instead of cloning it and passing an $account
Comment | File | Size | Author |
---|---|---|---|
#3 | 1375788-load-user-metadata-3.patch | 844 bytes | amitaibu |
entity-load-user.patch | 761 bytes | amitaibu | |
Comments
Comment #2
fagoSounds good. As test fails show, we need to check whether the uid property is set though. Maybe even better, only do that if the passed entity matches $GLOBALS['user'].
Comment #3
amitaibuOk, let's try this one..
Comment #4
fagothanks. I've changed it to use $GLOBALS['user'] to save a line, improved the comment a bit and committed it.