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

Double dots ('..') are removed from attachment names

Open freescout-helpdesk opened this issue 2 years ago • 0 comments

Describe the bug Double dots (..) are being removed from attachment names, i.e. test..txt becomes testtxt

Expected behavior test.txt

The reason is probably in https://github.com/Webklex/php-imap/blob/0966e53399f7c14880f7a3453ef28e6f8efe09b7/src/Attachment.php#L309

Possible solution:

return str_replace(['\\', '../', '/..', '/', chr(0), ':'], '', $name);

freescout-helpdesk avatar Dec 09 '23 17:12 freescout-helpdesk