From a7881754f5869860aac058d58838e5da72d3b40d Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Mon, 1 Sep 2014 13:51:49 +0200 Subject: fixed #403 --- src/eu/siacs/conversations/xml/Element.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/eu/siacs/conversations/xml/Element.java') diff --git a/src/eu/siacs/conversations/xml/Element.java b/src/eu/siacs/conversations/xml/Element.java index a09946c22..4e11ee2cd 100644 --- a/src/eu/siacs/conversations/xml/Element.java +++ b/src/eu/siacs/conversations/xml/Element.java @@ -4,6 +4,8 @@ import java.util.ArrayList; import java.util.Hashtable; import java.util.List; +import eu.siacs.conversations.utils.XmlHelper; + public class Element { protected String name; protected Hashtable attributes = new Hashtable(); @@ -116,7 +118,7 @@ public class Element { startTag.setAtttributes(this.attributes); elementOutput.append(startTag); if (content != null) { - elementOutput.append(encodeEntities(content)); + elementOutput.append(XmlHelper.encodeEntities(content)); } else { for (Element child : children) { elementOutput.append(child.toString()); @@ -132,15 +134,6 @@ public class Element { return name; } - private String encodeEntities(String content) { - content = content.replace("&", "&"); - content = content.replace("<", "<"); - content = content.replace(">", ">"); - content = content.replace("\"", """); - content = content.replace("'", "'"); - return content; - } - public void clearChildren() { this.children.clear(); } -- cgit v1.2.3