Merge pull request #4651 from christianbeeznest/GH-4650-bigupload

Learnpath: Fix special character when importing scorm with bigupload - refs #4650
pull/4657/head
Nicolas Ducoulombier 3 years ago committed by GitHub
commit 1e459ec89e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      main/inc/lib/javascript/bigupload/inc/bigUpload.php
  2. 1
      main/lp/scorm.class.php

@ -64,7 +64,9 @@ class BigUploadResponse
$this->tempName = $value; $this->tempName = $value;
} else { } else {
if ('learnpath' === $_REQUEST['origin'] && !empty($_REQUEST['name'])) { if ('learnpath' === $_REQUEST['origin'] && !empty($_REQUEST['name'])) {
$this->tempName = $_REQUEST['name']; $this->tempName = disable_dangerous_file(
api_replace_dangerous_char($_REQUEST['name'])
);
} else { } else {
$this->tempName = mt_rand().'.tmp'; $this->tempName = mt_rand().'.tmp';
} }

@ -720,6 +720,7 @@ class scorm extends learnpath
if ($updateDirContents && $lpToCheck) { if ($updateDirContents && $lpToCheck) {
$originalPath = str_replace('/.', '', $lpToCheck->path); $originalPath = str_replace('/.', '', $lpToCheck->path);
$originalPath = dirname($originalPath);
if ($originalPath != $newDir) { if ($originalPath != $newDir) {
Display::addFlash(Display::return_message(get_lang('FileError'))); Display::addFlash(Display::return_message(get_lang('FileError')));

Loading…
Cancel
Save