Permalink
Browse files

fix(avatars): avatars are no longer served with public URLs in a wall…

…ed garden mode

Avatar URLs are now tied to a user session if walled garden mode is enabled.

Refs #9518
  • Loading branch information...
hypeJunction committed Mar 26, 2016
1 parent 5c53527 commit 4c8a7ced7ec56637dd836f2854df9f276893b876
Showing with 2 additions and 1 deletion.
  1. +2 −1 engine/lib/users.php
View
@@ -466,7 +466,8 @@ function user_avatar_hook($hook, $entity_type, $returnvalue, $params) {
$filehandler = new ElggFile();
$filehandler->owner_guid = $user->guid;
$filehandler->setFilename("profile/{$user->guid}{$size}.jpg");
$avatar_url = elgg_get_inline_url($filehandler);
$use_cookie = elgg_get_config('walled_garden'); // don't serve avatars with public URLs in a walled garden mode
$avatar_url = elgg_get_inline_url($filehandler, $use_cookie);
return $avatar_url ? : $default_url;
}

0 comments on commit 4c8a7ce

Please sign in to comment.