From 838430eefd394366305b621bd6221a99d20fe4dc Mon Sep 17 00:00:00 2001 From: st143971 Date: Mon, 18 Sep 2023 06:05:23 +0200 Subject: [PATCH] Added context validation to external function, addressing https://github.com/SE-Stuttgart/moodle-block_slidefinder/issues/7 --- externallib.php | 3 +++ version.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/externallib.php b/externallib.php index 81cfbab..e718fc3 100644 --- a/externallib.php +++ b/externallib.php @@ -108,6 +108,9 @@ public static function get_searched_locations($userid, $courseid, $searchstring, return ''; } + $coursecontext = context_course::instance($course->id); + self::validate_context($coursecontext); + [$chapters, $misconfiguredchapters] = block_slidefinder_get_content_as_chapters_for_all_book_pdf_matches_from_course($courseid, $userid); diff --git a/version.php b/version.php index ad51aa2..ee1efd8 100644 --- a/version.php +++ b/version.php @@ -23,7 +23,7 @@ */ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2023091800; // The current plugin version (Date: YYYYMMDDHH). +$plugin->version = 2023091801; // The current plugin version (Date: YYYYMMDDHH). $plugin->requires = 2020061510; // Requires this Moodle version. $plugin->component = 'block_slidefinder'; // Full name of the plugin (used for diagnostics). $plugin->release = '1.1.1';