MDL-76362 h5p: Use string as default lang param

This commit is contained in:
Andrew Nicols 2023-01-06 22:29:25 +08:00
parent e76b1bcd5e
commit 6ae3f79c1e

View File

@ -58,8 +58,8 @@ switch ($action) {
$minor = optional_param('minorVersion', 0, PARAM_INT);
// Normalise Moodle language using underscore, as opposed to H5P which uses dash.
$language = optional_param('default-language', null, PARAM_RAW);
$language = clean_param(str_replace('-', '_', $language ?? ''), PARAM_LANG);
$language = optional_param('default-language', '', PARAM_RAW);
$language = clean_param(str_replace('-', '_', $language), PARAM_LANG);
if (!empty($name)) {
$editor->ajax->action(H5PEditorEndpoints::SINGLE_LIBRARY, $name,