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 11102c90cc
commit 388bedaf74
2 changed files with 10 additions and 1 deletions

View File

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

View File

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