diff --git a/public/lib/classes/output/core_renderer.php b/public/lib/classes/output/core_renderer.php
index d4b87f91953..40dad670724 100644
--- a/public/lib/classes/output/core_renderer.php
+++ b/public/lib/classes/output/core_renderer.php
@@ -1495,7 +1495,8 @@ class core_renderer extends renderer_base {
$context->ariarole = !empty($bc->attributes['role']) ? $bc->attributes['role'] : '';
$context->class = $bc->attributes['class'];
$context->type = $bc->attributes['data-block'];
- $context->title = $bc->title;
+ $context->title = (string) $bc->title;
+ $context->showtitle = $context->title !== '';
$context->content = $bc->content;
$context->annotation = $bc->annotation;
$context->footer = $bc->footer;
diff --git a/public/lib/templates/block.mustache b/public/lib/templates/block.mustache
index 9857ad8906e..840ef29a969 100644
--- a/public/lib/templates/block.mustache
+++ b/public/lib/templates/block.mustache
@@ -1,3 +1,16 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see
Hello block world!
" @@ -29,18 +43,18 @@ aria-label="{{arialabel}}" {{/arialabel}} {{^arialabel}} - {{#title}} + {{#showtitle}} aria-labelledby="instance-{{blockinstanceid}}-header" - {{/title}} + {{/showtitle}} {{/arialabel}}> {{! Block contents }}