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

cant save filenames with unallowed chars

Open cos2000 opened this issue 2 years ago • 0 comments

Hi there,

i want to save attachments from an email. The filename has unalloed chars (in my case is had a / in fillename). When i try to save this attachments i get a PHP error. in the function "save" under src/Attachment.php you use file_put_contents without checking filename for unallowed chars.

Under wimdows a / in filename is also not allowed. When i try to save attachments with a / in filename, then windows repaces it with _

I think its the best way to replace unallowed chars in filenames with _

thank you!

best regards

cos2000 avatar Feb 22 '23 21:02 cos2000