From 0b0b4009e2fdcf023e54b65949e58e178195cacc Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 10 Feb 2014 00:51:10 +0100 Subject: [PATCH] Relaxed parsing of encoded MIME headers --- charset.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charset.c b/charset.c index 0f76670..c80ce9e 100644 --- a/charset.c +++ b/charset.c @@ -232,7 +232,8 @@ static const char *find_encoded_word (const char *s, const char **x) ; if (q[0] != '?' || !strchr ("BbQq", q[1]) || q[2] != '?') continue; - for (q = q + 3; 0x20 < *q && *q < 0x7f && *q != '?'; q++) + /* non-strict check since many MUAs will not encode spaces and question marks */ + for (q = q + 3; 0x20 <= *q && *q < 0x7f && (*q != '?' || q[1] != '='); q++) ; if (q[0] != '?' || q[1] != '=') { -- 2.39.5