diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/ActiveSync.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/ActiveSync.cs
index 69934f4..c39eda6 100644
--- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/ActiveSync.cs
+++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/ActiveSync.cs
@@ -206,7 +206,7 @@ namespace Acacia.Utils
s.Append("1");
s.Append("Text");
s.Append("");
- s.Append(_value.Message[i].Message); // TODO: escaping
+ s.Append(_value.Message[i].Message.EncodeXML());
s.Append("");
}
}
diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/StringUtil.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/StringUtil.cs
index 6d990c0..c71a730 100644
--- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/StringUtil.cs
+++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/StringUtil.cs
@@ -76,6 +76,8 @@ namespace Acacia.Utils
#endregion
+ #region XML
+
public static string ToXMLString(this XmlNode xml)
{
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