From f0c6d1f1d3ea03bc921fbb776668b004dc8fa555 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 26 Feb 2014 21:26:39 +0100 Subject: [PATCH] Properly escape PubSub item's text (SMACK-546) --- .../org/jivesoftware/smackx/pubsub/provider/ItemProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/ItemProvider.java b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/ItemProvider.java index 74669e9c5..4496225b4 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/ItemProvider.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/pubsub/provider/ItemProvider.java @@ -20,6 +20,7 @@ import org.jivesoftware.smack.packet.PacketExtension; import org.jivesoftware.smack.provider.PacketExtensionProvider; import org.jivesoftware.smack.provider.ProviderManager; import org.jivesoftware.smack.util.PacketParserUtils; +import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smackx.pubsub.Item; import org.jivesoftware.smackx.pubsub.PayloadItem; import org.jivesoftware.smackx.pubsub.SimplePayload; @@ -101,7 +102,7 @@ public class ItemProvider implements PacketExtensionProvider } else if (parser.getEventType() == XmlPullParser.TEXT) { - payloadText.append(parser.getText()); + payloadText.append(StringUtils.escapeForXML(parser.getText())); } tag = parser.next(); }