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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, entity-load-user.patch, failed testing.

fago’s picture

Sounds 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'].

amitaibu’s picture

Status: Needs work » Needs review
FileSize
844 bytes

Ok, let's try this one..

fago’s picture

Status: Needs review » Fixed

thanks. I've changed it to use $GLOBALS['user'] to save a line, improved the comment a bit and committed it.

Status: Fixed » Closed (fixed)

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