MDL-84479 tool_usertours: verify sesskey prior to tour duplication.

This commit is contained in:
Paul Holden
2025-04-08 15:11:20 +00:00
committed by Jenkins
parent a0ff17c66d
commit ad5b72e696
2 changed files with 4 additions and 4 deletions
+2 -3
View File
@@ -208,12 +208,11 @@ class helper {
* @return \moodle_url The URL.
*/
public static function get_duplicate_tour_link($tourid) {
$link = new \moodle_url('/admin/tool/usertours/configure.php', [
return new \moodle_url('/admin/tool/usertours/configure.php', [
'action' => manager::ACTION_DUPLICATETOUR,
'id' => $tourid,
'sesskey' => sesskey(),
]);
return $link;
}
/**
+2 -1
View File
@@ -503,8 +503,9 @@ class manager {
* @param int $tourid The ID of the tour to duplicate.
*/
protected function duplicate_tour($tourid) {
$tour = helper::get_tour($tourid);
require_sesskey();
$tour = helper::get_tour($tourid);
$export = $tour->to_record();
// Remove the id.
unset($export->id);