From 904917d212ee09ca33c7c7bc3443b4226cd13668 Mon Sep 17 00:00:00 2001 From: Philipp Memmel Date: Sat, 6 May 2023 14:04:07 +0200 Subject: [PATCH] MBS-7648: Wrap text and title tags properly --- classes/mapworker.php | 6 ++++++ db/upgrade.php | 4 ++-- version.php | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/classes/mapworker.php b/classes/mapworker.php index 29b927f..fceddf1 100644 --- a/classes/mapworker.php +++ b/classes/mapworker.php @@ -84,6 +84,12 @@ class mapworker { */ public function __construct(string $svgcode, array $placestore, \cm_info $cm = null, bool $edit = false, int $group = 0) { global $CFG, $USER; + $svgcode = preg_replace('/(?!(<\!\[CDATA\[))(.*)<\/text>/', + '', + $svgcode); + $svgcode = preg_replace('/(?!(<\!\[CDATA\[))(.*)<\/title>/', + '', + $svgcode); $this->svgcode = $svgcode; $this->placestore = $placestore; $this->edit = $edit; diff --git a/db/upgrade.php b/db/upgrade.php index 75238a2..591ef0e 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -31,7 +31,7 @@ function xmldb_learningmap_upgrade($oldversion) { global $DB; - if ($oldversion < 2023011004) { + if ($oldversion < 2023050601) { $entries = $DB->get_records('learningmap', []); if ($entries) { foreach ($entries as $entry) { @@ -49,7 +49,7 @@ function xmldb_learningmap_upgrade($oldversion) { $DB->update_record('learningmap', $entry); } } - upgrade_mod_savepoint(true, 2023011004, 'learningmap'); + upgrade_mod_savepoint(true, 2023050601, 'learningmap'); } return true; } diff --git a/version.php b/version.php index 7274017..78ad127 100644 --- a/version.php +++ b/version.php @@ -25,8 +25,8 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'mod_learningmap'; -$plugin->release = '0.9.3'; -$plugin->version = 2023032402; +$plugin->release = '0.9.4'; +$plugin->version = 2023050601; $plugin->requires = 2020061500; $plugin->supported = [39, 402]; $plugin->maturity = MATURITY_BETA;