Commit a0407f6d authored by Sara Arjona's avatar Sara Arjona
Browse files

MDL-73128 badges: Fix warning with external badges

parent eab63d2c
...@@ -59,7 +59,8 @@ class core_badges_renderer extends plugin_renderer_base { ...@@ -59,7 +59,8 @@ class core_badges_renderer extends plugin_renderer_base {
$name = html_writer::tag('span', $bname, array('class' => 'badge-name')); $name = html_writer::tag('span', $bname, array('class' => 'badge-name'));
$image = html_writer::empty_tag('img', ['src' => $imageurl, 'class' => 'badge-image', 'alt' => $badge->imagecaption]); $imagecaption = $badge->imagecaption ?? '';
$image = html_writer::empty_tag('img', ['src' => $imageurl, 'class' => 'badge-image', 'alt' => $imagecaption]);
if (!empty($badge->dateexpire) && $badge->dateexpire < time()) { if (!empty($badge->dateexpire) && $badge->dateexpire < time()) {
$image .= $this->output->pix_icon('i/expired', $image .= $this->output->pix_icon('i/expired',
get_string('expireddate', 'badges', userdate($badge->dateexpire)), get_string('expireddate', 'badges', userdate($badge->dateexpire)),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment