Fixing upload + unzip see BT#8852

1.9.x
Julio Montoya 11 years ago
parent ac3d7525f0
commit b9668733c5
  1. 15
      main/inc/lib/fileUpload.lib.php

@ -1030,7 +1030,7 @@ function unzip_uploaded_document(
$courseInfo,
$userInfo,
$uploaded_file,
$upload_path,
$uploadPath,
$base_work_dir,
$maxFilledSpace,
$sessionId = 0,
@ -1074,7 +1074,8 @@ function unzip_uploaded_document(
$destinationDir,
$sessionId,
$groupId,
$output
$output,
array('path' => $uploadPath)
);
if (is_dir($destinationDir)) {
@ -2004,6 +2005,7 @@ function build_missing_files_form($missing_files, $upload_path, $file_name)
* @param int $groupId
* @param bool $output
* @param array $parent
* @param string $uploadPath
*
*/
function add_all_documents_in_folder_to_database(
@ -2029,16 +2031,22 @@ function add_all_documents_in_folder_to_database(
if (is_dir($folderPath)) {
// Run trough
while ($file = readdir($handle)) {
if ($file == '.' || $file == '..') {
continue;
}
$parentPath = null;
if (!empty($parent)) {
if (!empty($parent) && isset($parent['path'])) {
$parentPath = $parent['path'];
if ($parentPath == '/') {
$parentPath = null;
}
}
$completePath = $parentPath.'/'.$file;
$sysFolderPath = $folderPath.'/'.$file;
// Is directory?
@ -2055,7 +2063,6 @@ function add_all_documents_in_folder_to_database(
null,
true
);
$files[$file] = $newFolderData;
// Recursive

Loading…
Cancel
Save