Subject: Re: [sup-devel] [PATCH] Bugfix: fix regexp for detecting filename in Content-Disposition header

From: Rich Lane <[email-masked]>
Date: Mon, 11 Oct 2010 21:37:59 -0400

Applied to master.
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Michael Stapelberg <[email-masked]>
Date: Sun, 10 Oct 2010 23:02:28 +0200

Hi,

quote from the commit message:

    In a message written in some Microsoft mail program (the only header is
    "X-MimeOLE: Produced By Microsoft Exchange V6.5"), the filename part of
    the Content-Disposition header spans multiple lines (due to the filename
    being very long and encoded in base64 due to the use of UTF-8):
    
    Content-Disposition: attachment;
            filename="=?utf-8?B?VGFnIGRlciBPZmZlbmVuIFTDvHIgZGVzIFByb2pla3Rl?=
            =?utf-8?B?cyBMZXJucGF0ZW5zY2hhZnRlbiBpbSBFbW1lcnRzZ3I=?=
            =?utf-8?B?dW5kLmRvY3g=?="
    
    The previous regexp did not properly match the whole string, but only the
    first line. This is fixed by adding the 'm' option (to match newlines as
    characters) and using \z instead of $ ("end of string" instead of "end of
    line").
    
    The same fix is also applied to the Content-Type header one line below.

Best regards,
Michael