MDL-17236 html block: proper cleanup of html

This commit is contained in:
skodak
2008-11-19 16:46:41 +00:00
parent 38d044fc91
commit e8a7edd7d6
2 changed files with 16 additions and 4 deletions
+7 -2
View File
@@ -24,8 +24,13 @@ class block_html extends block_base {
return $this->content;
}
$filteropt = new stdClass;
$filteropt->noclean = true;
if (!empty($this->instance->pinned) or $this->instance->pagetype === 'course-view') {
// fancy html allowed only on course page and in pinned blocks for security reasons
$filteropt = new stdClass;
$filteropt->noclean = true;
} else {
$filteropt = null;
}
$this->content = new stdClass;
$this->content->text = isset($this->config->text) ? format_text($this->config->text, FORMAT_HTML, $filteropt) : '';