Fixed move content folder bug

HFP-822
pull/38/head
thomasmars 2017-03-14 15:00:14 +01:00
parent 754346992b
commit 75b8f9efd6
1 changed files with 4 additions and 4 deletions

View File

@ -319,7 +319,7 @@ class H5PDefaultStorage implements \H5PFileStorage {
copy($_FILES['file']['tmp_name'], $path); copy($_FILES['file']['tmp_name'], $path);
} }
return $path; return $file;
} }
/** /**
@ -379,11 +379,11 @@ class H5PDefaultStorage implements \H5PFileStorage {
$contentSource = $source . DIRECTORY_SEPARATOR . 'content'; $contentSource = $source . DIRECTORY_SEPARATOR . 'content';
$contentFiles = array_diff(scandir($contentSource), array('.','..', 'content.json')); $contentFiles = array_diff(scandir($contentSource), array('.','..', 'content.json'));
foreach ($contentFiles as $file) { foreach ($contentFiles as $file) {
if (is_dir($contentSource)) { if (is_dir("{$contentSource}/{$file}")) {
self::copyFileTree($contentSource, $target); self::copyFileTree("{$contentSource}/{$file}", "{$target}/{$file}");
} }
else { else {
copy($contentSource . DIRECTORY_SEPARATOR . $file, $target . DIRECTORY_SEPARATOR . $file); copy("{$contentSource}/{$file}", "{$target}/{$file}");
} }
} }