Minor - fix php warning

pull/2458/head
jmontoyaa 8 years ago
parent 7538c08354
commit 794ee40c0b
  1. 6
      main/inc/lib/message.lib.php

@ -713,7 +713,11 @@ class MessageManager
$tbl_message_attach = Database::get_main_table(TABLE_MESSAGE_ATTACHMENT);
// Try to add an extension to the file if it hasn't one
$new_file_name = add_ext_on_mime(stripslashes($file_attach['name']), $file_attach['type']);
$type = isset($file_attach['type']) ? $file_attach['type'] : '';
if (empty($type)) {
$type = DocumentManager::file_get_mime_type($file_attach['name']);
}
$new_file_name = add_ext_on_mime(stripslashes($file_attach['name']), $type);
// user's file name
$file_name = $file_attach['name'];

Loading…
Cancel
Save