Fix rename issue when uploading files using ajax.

Undo change

8f864966c9
1.10.x
jmontoyaa 9 years ago
parent 5f4aa3e782
commit a26f23bde1
  1. 10
      main/inc/lib/document.lib.php

@ -2821,12 +2821,6 @@ class DocumentManager
$upload_ok = process_uploaded_file($files[$fileKey], $show_output); $upload_ok = process_uploaded_file($files[$fileKey], $show_output);
if ($upload_ok) { 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( $new_path = handle_uploaded_document(
$course_info, $course_info,
$files[$fileKey], $files[$fileKey],
@ -2873,6 +2867,10 @@ class DocumentManager
} }
}*/ }*/
if (!empty($title)) {
$params['title'] = $title;
}
if (!empty($comment)) { if (!empty($comment)) {
$params['comment'] = trim($comment); $params['comment'] = trim($comment);
} }

Loading…
Cancel
Save