1
0
mirror of https://github.com/Kopano-dev/kopano-ol-extension.git synced 2023-10-10 13:37:40 +02:00

[KOE-96] Added XML escaping to OOF messages.

This commit is contained in:
Patrick Simpson 2017-04-05 10:28:24 +02:00
parent ab909dc4c5
commit 4b0df802c4
2 changed files with 10 additions and 1 deletions

View File

@ -266,7 +266,7 @@ namespace Acacia.Utils
s.Append("<Enabled>1</Enabled>");
s.Append("<BodyType>Text</BodyType>");
s.Append("<ReplyMessage>");
s.Append(_value.Message[i].Message); // TODO: escaping
s.Append(_value.Message[i].Message.EncodeXML());
s.Append("</ReplyMessage>");
}
}

View File

@ -77,6 +77,8 @@ namespace Acacia.Utils
#endregion
#region XML
public static string ToXMLString(this XmlNode xml)
{
using (var stringWriter = new StringWriter())
@ -88,6 +90,13 @@ namespace Acacia.Utils
}
}
public static string EncodeXML(this string s)
{
return System.Security.SecurityElement.Escape(s);
}
#endregion
#region Resources