Commit 98ba4b33 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

MessageFactoryNG: also replace ${} wrapper from MDN templates

Found by MessageFactoryTest::testCreateMDN being broken
parent ee84101b
Pipeline #74561 passed with stage
in 24 minutes and 43 seconds
......@@ -917,14 +917,14 @@ QString MessageFactoryNG::replaceHeadersInString(const KMime::Message::Ptr &msg,
int idx = 0;
for (auto match = rx.match(result); match.hasMatch(); match = rx.match(result, idx)) {
idx = match.capturedStart(1);
idx = match.capturedStart(0);
const QByteArray ba = match.captured(1).toLatin1();
if (auto hdr = msg->headerByType(ba.constData())) {
const auto replacement = hdr->asUnicodeString();
result.replace(idx, match.capturedLength(1), replacement);
result.replace(idx, match.capturedLength(0), replacement);
idx += replacement.length();
} else {
result.remove(idx, match.capturedLength(1));
result.remove(idx, match.capturedLength(0));
}
}
return result;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment