Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
fix(Felamimail) AttachmentCache for attachements without name fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmhh committed Jul 25, 2022
1 parent 94ca5fb commit f5e1023
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tine20/Felamimail/Controller/AttachmentCache.php
Expand Up @@ -100,8 +100,11 @@ protected function _inspectBeforeCreate(Tinebase_Record_Interface $_record)
}
rewind($stream);

if (false === ($name = iconv(mb_detect_encoding($fileName), "UTF-8//IGNORE", $fileName))) {
throw new Tinebase_Exception_UnexpectedValue('can not convert filename to utf8 ' . $fileName);
if (!$fileName || false === ($name = iconv(mb_detect_encoding($fileName), "UTF-8//IGNORE", $fileName))) {
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' .
__LINE__ . ' no usable filename available');

$name = 'unknown file name ' . uniqid();
}

$_record->attachments = new Tinebase_Record_RecordSet(Tinebase_Model_Tree_Node::class, [
Expand Down

0 comments on commit f5e1023

Please sign in to comment.