From 4979a34ac506540f12389a7ae42d64085636be3b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Wed, 21 Apr 2010 22:42:11 +0000 Subject: [PATCH] * ParseMessageListHeaders_Detail(): don't use the tokenizer to read the subject; this works around pipes in mail subjects --- webcit/msg_renderers.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/webcit/msg_renderers.c b/webcit/msg_renderers.c index 03b819152..d3a7c423f 100644 --- a/webcit/msg_renderers.c +++ b/webcit/msg_renderers.c @@ -1208,7 +1208,23 @@ int ParseMessageListHeaders_Detail(StrBuf *Line, */ StrBufSkip_NTokenS(Line, pos, '|', 1); Msg->subj = NewStrBufPlain(NULL, StrLength(Line)); + + FlushStrBuf(ConversionBuffer); + /* we assume the subject is the last parameter inside of the list; + * thus we don't use the tokenizer to fetch it, since it will hick up + * on tokenizer chars inside of the subjects StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|'); + */ + if (*pos != StrBufNOTNULL) { + StrBufPlain(ConversionBuffer, *pos, + StrLength(Line) - (*pos - ChrPtr(Line))); + *pos = StrBufNOTNULL; + if ((StrLength(ConversionBuffer) > 0) && + (*(ChrPtr(ConversionBuffer) + + StrLength(ConversionBuffer) - 1) == '|')) + StrBufCutRight(ConversionBuffer, 1); + } + if (StrLength(ConversionBuffer) == 0) StrBufAppendBufPlain(Msg->subj, _("(no subject)"), -1,0); else { -- 2.30.2