diff --git a/main/inc/lib/document.lib.php b/main/inc/lib/document.lib.php index 9b1e4c289f..5a15839f7f 100755 --- a/main/inc/lib/document.lib.php +++ b/main/inc/lib/document.lib.php @@ -2821,12 +2821,6 @@ class DocumentManager $upload_ok = process_uploaded_file($files[$fileKey], $show_output); if ($upload_ok) { - // File got on the server without problems, now process it - if ($title) { - $titleAndExt = explode('.', $files[$fileKey]['name']); - $ext = end($titleAndExt); - $files[$fileKey]['name'] = $title.'.'.$ext; - } $new_path = handle_uploaded_document( $course_info, $files[$fileKey], @@ -2873,6 +2867,10 @@ class DocumentManager } }*/ + if (!empty($title)) { + $params['title'] = $title; + } + if (!empty($comment)) { $params['comment'] = trim($comment); }