MDL-67707 course: add support for PARAM_ALPHANUM module names

This commit is contained in:
Ferran Recio 2020-02-05 16:57:11 +01:00
parent 73f8c56dfc
commit 1e7e255d72
4 changed files with 4 additions and 3 deletions

View File

@ -27,7 +27,7 @@ require("../config.php");
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);

View File

@ -31,7 +31,7 @@ require_once($CFG->libdir.'/completionlib.php');
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

View File

@ -942,7 +942,7 @@ abstract class moodleform_mod extends moodleform {
$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);

View File

@ -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 ===