From a357fbfd50446d864d8f02bb74e090be6ee89089 Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 17 Apr 2014 13:01:29 +0000 Subject: [PATCH] Core/POP3: MIMEHeader parsing improved git-svn-id: svn://ultimatepp.org/upp/trunk@7272 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/POP3/InetMessage.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/uppsrc/Core/POP3/InetMessage.cpp b/uppsrc/Core/POP3/InetMessage.cpp index 92af0d243..26de0a183 100644 --- a/uppsrc/Core/POP3/InetMessage.cpp +++ b/uppsrc/Core/POP3/InetMessage.cpp @@ -198,6 +198,9 @@ bool MIMEHeader::Parse(const char *s) while(!p.IsEof() && !p.IsChar(';')) p.SkipTerm(); value = TrimBoth(String(b, p.GetPtr())); + if(*value == '\'' && *value.Last() == '\'' || // mime type can be quoted... + *value == '\"' && *value.Last() == '\"') + value = TrimBoth(value.Mid(1, value.GetCount() - 2)); while(!p.IsEof()) { if(p.Char(';') && p.IsId()) { const char *b = p.GetPtr(); @@ -206,6 +209,9 @@ bool MIMEHeader::Parse(const char *s) String id = ToLower(TrimBoth(String(b, p.GetPtr()))); String val; if(p.Char('=')) + if(p.IsChar('\'')) + val = p.ReadString('\''); + else if(p.IsString()) val = p.ReadString(); else {