Skip to content

Commit

Permalink
MDL-67707 course: add support for PARAM_ALPHANUM module names
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranrecio committed Mar 16, 2020
1 parent 73f8c56 commit 1e7e255
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion course/mod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion course/modedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion course/moodleform_mod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions course/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===

Expand Down

0 comments on commit 1e7e255

Please sign in to comment.