From: Wilfried Göesgens Date: Wed, 21 Apr 2010 22:42:11 +0000 (+0000) Subject: * ParseMessageListHeaders_Detail(): don't use the tokenizer to read the subject;... X-Git-Tag: v7.86~258 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=4979a34ac506540f12389a7ae42d64085636be3b * ParseMessageListHeaders_Detail(): don't use the tokenizer to read the subject; this works around pipes in mail subjects --- 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 {