barbushin/php-imap — pull request #63 by christianasche (2014-10-17 07:45:40+00:00)
Title: Changed isUrlEncoded, to handle weird attachment names

Thank you for creating this class. We use it everyday to handle thousands of incoming emails.

Sometimes the filenames of attachments are completely converted, even alnum chars.

This is a part from an example email, sent from thunderbird. The attachment name is Führerschein (driver's license):
...
Content-Disposition: attachment;
filename*0*=UTF-8''%46%C3%BC%68%72%65%72%73%63%68%65%69%6E;
...

This breaks the detection isUrlEncoded() and the resulting attachment filename is something similar to UTF-8''%46%C3%BC%68%72%65%72%73%63%68%65%69%6E

This commit uses another approach to detect if the filename is url encoded.

I hope this helps a little.