Commit d764a1ab authored by Astor Bizard's avatar Astor Bizard 🐕
Browse files

Fixed seed being capped at 2^31 because of int conversion.

parent cc60d6d1
......@@ -23,8 +23,8 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2022021800;
$plugin->version = 2022021801;
$plugin->requires = 2018112800;
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '1.4.2';
$plugin->release = '1.4.3';
$plugin->component = 'mod_randomactivity';
......@@ -75,8 +75,8 @@ if ( !has_capability('mod/randomactivity:manage', $context)
if (data_submitted()) {
// Form has been submitted.
if (confirm_sesskey() && has_capability('mod/randomactivity:manage', $context)) {
$module->seed = required_param('seed', PARAM_INT);
$module->activities = trim(required_param('activities', PARAM_RAW));
$module->seed = preg_replace('/[^0-9]/', '', required_param('seed', PARAM_RAW));
$module->activities = required_param('activities', PARAM_RAW_TRIMMED);
try {
randomactivity_update_instance($module);
$message = get_string('changesapplied', RANDOMACTIVITY);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment