Escape message tag values (ref #684)

This commit is contained in:
J-P Nurmi
2014-09-29 14:23:06 +02:00
parent 615801c40e
commit 92c9a2e6ae
5 changed files with 81 additions and 9 deletions
+4 -2
View File
@@ -484,7 +484,9 @@ MCString CUtils::GetMessageTags(const CString& sLine) {
MCString mssTags;
for (VCString::const_iterator it = vsTags.begin(); it != vsTags.end(); ++it) {
mssTags[it->Token(0, false, "=", true)] = it->Token(1, true, "=", true);
CString sKey = it->Token(0, false, "=", true);
CString sValue = it->Token(1, true, "=", true);
mssTags[sKey] = sValue.Escape(CString::EMSGTAG, CString::CString::EASCII);
}
return mssTags;
}
@@ -504,7 +506,7 @@ void CUtils::SetMessageTags(CString& sLine, const MCString& mssTags) {
}
sTags += it->first;
if (!it->second.empty())
sTags += "=" + it->second;
sTags += "=" + it->second.Escape_n(CString::EMSGTAG);
}
sLine = "@" + sTags + " " + sLine;
}