aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/xml
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-03-16 14:12:30 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-03-16 14:12:30 +0100
commit0116551ca9b99c58e0459d52f66d5d9bfa1c2afa (patch)
tree7a221e528a12c6a9998e1f3ff6cdda02356f6601 /src/eu/siacs/conversations/xml
parent0b3b0da2e8db96f68ddfe35d6f9294ee58c9323e (diff)
bug fixes with leaving muc on connection loss.
Diffstat (limited to 'src/eu/siacs/conversations/xml')
-rw-r--r--src/eu/siacs/conversations/xml/Element.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/xml/Element.java b/src/eu/siacs/conversations/xml/Element.java
index ad95ef9c..6cf6d3a5 100644
--- a/src/eu/siacs/conversations/xml/Element.java
+++ b/src/eu/siacs/conversations/xml/Element.java
@@ -4,8 +4,6 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
-import android.util.Log;
-
public class Element {
protected String name;
protected Hashtable<String, String> attributes = new Hashtable<String, String>();
@@ -83,7 +81,7 @@ public class Element {
startTag.setAtttributes(this.attributes);
elementOutput.append(startTag);
if (content!=null) {
- elementOutput.append(content);
+ elementOutput.append(encodeEntities(content));
} else {
for(Element child : children) {
elementOutput.append(child.toString());
@@ -98,4 +96,13 @@ public class Element {
public String getName() {
return name;
}
+
+ private String encodeEntities(String content) {
+ content = content.replace("&","&amp;");
+ content = content.replace("<","&lt;");
+ content = content.replace(">","&gt;");
+ content = content.replace("\"","&quot;");
+ content = content.replace("'","&apos;");
+ return content;
+ }
}