diff --git a/course/mod.php b/course/mod.php index 54f6f9cb5a293..67719a7aae2c4 100644 --- a/course/mod.php +++ b/course/mod.php @@ -27,7 +27,7 @@ require_once("lib.php"); $sectionreturn = optional_param('sr', null, PARAM_INT); -$add = optional_param('add', '', PARAM_ALPHA); +$add = optional_param('add', '', PARAM_ALPHANUM); $type = optional_param('type', '', PARAM_ALPHA); $indent = optional_param('indent', 0, PARAM_INT); $update = optional_param('update', 0, PARAM_INT); diff --git a/course/modedit.php b/course/modedit.php index f048bcd25e43a..0388708c9a06c 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -31,7 +31,7 @@ require_once($CFG->libdir.'/plagiarismlib.php'); require_once($CFG->dirroot . '/course/modlib.php'); -$add = optional_param('add', '', PARAM_ALPHA); // module name +$add = optional_param('add', '', PARAM_ALPHANUM); // Module name. $update = optional_param('update', 0, PARAM_INT); $return = optional_param('return', 0, PARAM_BOOL); //return to course/view.php if false or mod/modname/view.php if true $type = optional_param('type', '', PARAM_ALPHANUM); //TODO: hopefully will be removed in 2.0 diff --git a/course/moodleform_mod.php b/course/moodleform_mod.php index 34c25f04735c7..2bbdac012dcee 100644 --- a/course/moodleform_mod.php +++ b/course/moodleform_mod.php @@ -942,7 +942,7 @@ function standard_hidden_coursemodule_elements(){ $mform->setType('instance', PARAM_INT); $mform->addElement('hidden', 'add', 0); - $mform->setType('add', PARAM_ALPHA); + $mform->setType('add', PARAM_ALPHANUM); $mform->addElement('hidden', 'update', 0); $mform->setType('update', PARAM_INT); diff --git a/course/upgrade.txt b/course/upgrade.txt index f88a58bb4f759..195a6ebf7fc55 100644 --- a/course/upgrade.txt +++ b/course/upgrade.txt @@ -4,6 +4,7 @@ information provided here is intended especially for developers. === 3.9 === * The function get_module_metadata is now deprecated. Please use \core_course\local\service\content_item_service instead. +* Activity module names are now PARAM_ALPHANUM instead of PARAM_ALPHA so integers can be used in activity module names === 3.8 ===