diff options
author | Florent Le Coz <louiz@louiz.org> | 2013-12-11 21:22:06 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2013-12-15 00:34:30 +0100 |
commit | 7d8ce3b5638b8e09313a6218014a307ab98e6289 (patch) | |
tree | aa6e6b2172d05037a710b314ad8b55c45d48dd29 /src/xmpp | |
parent | 3960e4d5afa09c299f595b411ee8522db30580fd (diff) | |
download | biboumi-7d8ce3b5638b8e09313a6218014a307ab98e6289.tar.gz biboumi-7d8ce3b5638b8e09313a6218014a307ab98e6289.tar.bz2 biboumi-7d8ce3b5638b8e09313a6218014a307ab98e6289.tar.xz biboumi-7d8ce3b5638b8e09313a6218014a307ab98e6289.zip |
Use XML-sanitized strings when serializing stanzas for the XMPP server
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/xmpp_stanza.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/xmpp/xmpp_stanza.cpp b/src/xmpp/xmpp_stanza.cpp index 34ba85f..b6f5a23 100644 --- a/src/xmpp/xmpp_stanza.cpp +++ b/src/xmpp/xmpp_stanza.cpp @@ -192,12 +192,13 @@ std::string XmlNode::to_string() const std::string res("<"); res += this->name; for (const auto& it: this->attributes) - res += " " + it.first + "='" + it.second + "'"; + res += " " + utils::remove_invalid_xml_chars(it.first) + "='" + + utils::remove_invalid_xml_chars(it.second) + "'"; if (this->closed && !this->has_children() && this->inner.empty()) res += "/>"; else { - res += ">" + this->inner; + res += ">" + utils::remove_invalid_xml_chars(this->inner); for (const auto& child: this->children) res += child->to_string(); if (this->closed) @@ -205,7 +206,7 @@ std::string XmlNode::to_string() const res += "</" + this->name + ">"; } } - res += this->tail; + res += utils::remove_invalid_xml_chars(this->tail); return res; } |