php-imap
php-imap copied to clipboard
Double dots ('..') are removed from attachment names
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);