Add hash to image url to force browser to update profile when changed
Closes #4241
This commit is contained in:
committed by
Frédéric Guillot
parent
8b2d46ed5d
commit
4d07628054
@@ -23,7 +23,7 @@ class AvatarFileProvider extends Base implements AvatarProviderInterface
|
|||||||
*/
|
*/
|
||||||
public function render(array $user, $size)
|
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']);
|
$title = $this->helper->text->e($user['name'] ?: $user['username']);
|
||||||
return '<img src="' . $url . '" alt="' . $title . '" title="' . $title . '">';
|
return '<img src="' . $url . '" alt="' . $title . '" title="' . $title . '">';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class UserMentionFormatterTest extends Base
|
|||||||
$expected = array(
|
$expected = array(
|
||||||
array(
|
array(
|
||||||
'value' => 'someone',
|
'value' => 'someone',
|
||||||
'html' => '<div class="avatar avatar-20 avatar-inline"><img src="?controller=AvatarFileController&action=image&user_id=1&size=20" alt="Someone" title="Someone"></div> someone <small>Someone</small>',
|
'html' => '<div class="avatar avatar-20 avatar-inline"><img src="?controller=AvatarFileController&action=image&user_id=1&hash=5acc03af0274414544b9615fb223d925&size=20" alt="Someone" title="Someone"></div> someone <small>Someone</small>',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'value' => 'somebody',
|
'value' => 'somebody',
|
||||||
|
|||||||
Reference in New Issue
Block a user