SSilence / php-imap-client

a easy solution for simple IMAP email access in php
MIT License
268 stars 138 forks source link

Problem with empty attachment name #256

Open tuptuptup opened 3 years ago

tuptuptup commented 3 years ago

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.