mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-40162 badges: Image url breaks when slashargumets is not supported
This commit is contained in:
parent
838d78a9ff
commit
b143259ee0
1 changed files with 2 additions and 1 deletions
|
@ -1025,7 +1025,8 @@ function print_badge_image(badge $badge, stdClass $context, $size = 'small') {
|
||||||
|
|
||||||
$imageurl = moodle_url::make_pluginfile_url($context->id, 'badges', 'badgeimage', $badge->id, '/', $fsize, false);
|
$imageurl = moodle_url::make_pluginfile_url($context->id, 'badges', 'badgeimage', $badge->id, '/', $fsize, false);
|
||||||
// Appending a random parameter to image link to forse browser reload the image.
|
// Appending a random parameter to image link to forse browser reload the image.
|
||||||
$attributes = array('src' => $imageurl . '?' . rand(1, 10000), 'alt' => s($badge->name), 'class' => 'activatebadge');
|
$imageurl->param('refresh', rand(1, 10000));
|
||||||
|
$attributes = array('src' => $imageurl, 'alt' => s($badge->name), 'class' => 'activatebadge');
|
||||||
|
|
||||||
return html_writer::empty_tag('img', $attributes);
|
return html_writer::empty_tag('img', $attributes);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue