summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoanna Hulboj <joanna.hulboj@isode.com>2017-01-27 10:03:51 (GMT)
committerJoanna Hulboj <joanna.hulboj@isode.com>2017-02-21 10:56:33 (GMT)
commit80801aaeba2d29e3a375a01d782cf081e778dfaf (patch)
tree090b3c87e90e7518dc93915c4e34ca30286a24f8 /Swiften/Serializer
parent12691f0c76a779e44445dca372bc19fb022437c3 (diff)
downloadswift-80801aaeba2d29e3a375a01d782cf081e778dfaf.zip
swift-80801aaeba2d29e3a375a01d782cf081e778dfaf.tar.bz2
Add checks to verify if the input data is a valid XML/XMPP
Test-Information: Unit tests pass OK. Change-Id: Ibd7897c1c1249af7ac60a6549afd4c2362fcf0c0
Diffstat (limited to 'Swiften/Serializer')
-rw-r--r--Swiften/Serializer/StanzaSerializer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Swiften/Serializer/StanzaSerializer.cpp b/Swiften/Serializer/StanzaSerializer.cpp
index f2f5529..3de706d 100644
--- a/Swiften/Serializer/StanzaSerializer.cpp
+++ b/Swiften/Serializer/StanzaSerializer.cpp
@@ -9,6 +9,7 @@
#include <sstream>
#include <typeinfo>
+#include <Swiften/Base/String.h>
#include <Swiften/Base/Log.h>
#include <Swiften/Elements/Stanza.h>
#include <Swiften/Serializer/PayloadSerializer.h>
@@ -55,6 +56,7 @@ SafeByteArray StanzaSerializer::serialize(std::shared_ptr<ToplevelElement> eleme
SWIFT_LOG(warning) << "Could not find serializer for " << typeid(*(payload.get())).name() << std::endl;
}
}
+ serializedPayloads = String::sanitizeXMPPString(serializedPayloads);
if (!serializedPayloads.empty()) {
stanzaElement.addNode(std::make_shared<XMLRawTextNode>(serializedPayloads));
}