php-imap-client icon indicating copy to clipboard operation
php-imap-client copied to clipboard

Problem with empty attachment name

Open tuptuptup opened this issue 4 years ago • 0 comments

There is a problem with attachments, when filename contain diacritic symbols. For example, if original filename is "zażółć gęślą jaźń.pdf", I get an empty attachment filename.

In file IncomingMessageAttachment.php in function getName() after: if (strtolower($param->attribute) === 'filename') { $this->name = $param->value; break; } I added: else{ $this->name = str_replace(array("'"," ","UTF-8"),array("","",""),(urldecode($param->value)); } Now it's works.

tuptuptup avatar Jan 04 '21 09:01 tuptuptup