From efc16fbe2ac5a30d141e4e58d60e934ae1f2469c Mon Sep 17 00:00:00 2001 From: Alexander Bias <alexander.bias@uni-ulm.de> Date: Thu, 14 Jan 2021 14:53:07 +0100 Subject: [PATCH] Bugfix: The infobanner should not clean the entered HTML code too strictly. --- CHANGES.md | 5 +++++ layout/columns2.php | 6 ++++-- layout/login.php | 6 ++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3caecb2..cf7b7cf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,11 @@ moodle-theme_boost_campus Changes ------- + +### Unreleased + +* 2021-01-14 - Bugfix: The infobanner should not clean the entered HTML code too strictly. + ### Release v3.9-r4 * 2020-11-18 - Change in Moodle release support: diff --git a/layout/columns2.php b/layout/columns2.php index b21373f..86aa04a 100644 --- a/layout/columns2.php +++ b/layout/columns2.php @@ -111,7 +111,8 @@ $templatecontext = [ $perpibenable = get_config('theme_boost_campus', 'perpibenable'); if ($perpibenable) { - $perpibcontent = format_text(get_config('theme_boost_campus', 'perpibcontent'), FORMAT_HTML); + $formatoptions = array('noclean' => true, 'newlines' => false); + $perpibcontent = format_text(get_config('theme_boost_campus', 'perpibcontent'), FORMAT_HTML, $formatoptions); // Result of multiselect is a string divided by a comma, so exploding into an array. $perpibshowonpages = explode(",", get_config('theme_boost_campus', 'perpibshowonpages')); $perpibcss = get_config('theme_boost_campus', 'perpibcss'); @@ -135,7 +136,8 @@ if ($perpibenable) { $timedibenable = get_config('theme_boost_campus', 'timedibenable'); if ($timedibenable) { - $timedibcontent = format_text(get_config('theme_boost_campus', 'timedibcontent'), FORMAT_HTML); + $formatoptions = array('noclean' => true, 'newlines' => false); + $timedibcontent = format_text(get_config('theme_boost_campus', 'timedibcontent'), FORMAT_HTML, $formatoptions); // Result of multiselect is a string divided by a comma, so exploding into an array. $timedibshowonpages = explode(",", get_config('theme_boost_campus', 'timedibshowonpages')); $timedibcss = get_config('theme_boost_campus', 'timedibcss'); diff --git a/layout/login.php b/layout/login.php index 2d4c3f8..2c14fbb 100644 --- a/layout/login.php +++ b/layout/login.php @@ -48,7 +48,8 @@ $templatecontext = [ $perpibenable = get_config('theme_boost_campus', 'perpibenable'); if ($perpibenable) { - $perpibcontent = format_text(get_config('theme_boost_campus', 'perpibcontent'), FORMAT_HTML); + $formatoptions = array('noclean' => true, 'newlines' => false); + $perpibcontent = format_text(get_config('theme_boost_campus', 'perpibcontent'), FORMAT_HTML, $formatoptions); // Result of multiselect is a string divided by a comma, so exploding into an array. $perpibshowonpages = explode(",", get_config('theme_boost_campus', 'perpibshowonpages')); $perpibcss = get_config('theme_boost_campus', 'perpibcss'); @@ -67,7 +68,8 @@ if ($perpibenable) { $timedibenable = get_config('theme_boost_campus', 'timedibenable'); if ($timedibenable) { - $timedibcontent = format_text(get_config('theme_boost_campus', 'timedibcontent'), FORMAT_HTML); + $formatoptions = array('noclean' => true, 'newlines' => false); + $timedibcontent = format_text(get_config('theme_boost_campus', 'timedibcontent'), FORMAT_HTML, $formatoptions); // Result of multiselect is a string divided by a comma, so exploding into an array. $timedibshowonpages = explode(",", get_config('theme_boost_campus', 'timedibshowonpages')); $timedibcss = get_config('theme_boost_campus', 'timedibcss'); -- GitLab