Add hash to image url to force browser to update profile when changed

Closes #4241
This commit is contained in:
Rafael de Camargo
2019-08-26 01:59:53 -03:00
committed by Frédéric Guillot
parent 8b2d46ed5d
commit 4d07628054
2 changed files with 2 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ class AvatarFileProvider extends Base implements AvatarProviderInterface
*/
public function render(array $user, $size)
{
$url = $this->helper->url->href('AvatarFileController', 'image', array('user_id' => $user['id'], 'size' => $size));
$url = $this->helper->url->href('AvatarFileController', 'image', array('user_id' => $user['id'], 'hash' => md5($user['avatar_path']), 'size' => $size));
$title = $this->helper->text->e($user['name'] ?: $user['username']);
return '<img src="' . $url . '" alt="' . $title . '" title="' . $title . '">';
}