Merge branch 'MDL-67057-master' of git://github.com/andrewnicols/moodle

This commit is contained in:
Adrian Greeve 2019-11-07 11:59:00 +08:00
commit d5e303f8e3
2 changed files with 1 additions and 3 deletions

View File

@ -51,6 +51,7 @@ class helper {
\core_php_time_limit::raise();
$core = $factory->get_core();
$core->h5pF->set_file($file);
$path = $core->fs->getTmpPath();
$core->h5pF->getUploadedH5pFolderPath($path);
// Add manually the extension to the file to avoid the validation fails.

View File

@ -285,9 +285,6 @@ class player {
// content-type libraries exist, to avoid users without the h5p:updatelibraries capability upload malicious content.
$onlyupdatelibs = !helper::can_update_library($file);
// Set the .h5p file, in order to check later the permissions to update libraries.
$this->core->h5pF->set_file($file);
// Validate and store the H5P content before displaying it.
$h5pid = helper::save_h5p($this->factory, $file, $config, $onlyupdatelibs, false);
if (!$h5pid && $file->get_userid() != $USER->id && has_capability('moodle/h5p:updatelibraries', $this->context)) {