Use XML-sanitized strings when serializing stanzas for the XMPP server

This commit is contained in:
Florent Le Coz
2013-12-15 00:34:30 +01:00
parent 3960e4d5af
commit 7d8ce3b563
2 changed files with 12 additions and 3 deletions
+8
View File
@@ -97,6 +97,14 @@ int main()
});
xml.feed(doc.data(), doc.size(), true);
const std::string doc2 = "<stream xmlns='s'><stanza>coucou\r\n\a</stanza></stream>";
xml.add_stanza_callback([](const Stanza& stanza)
{
std::cout << stanza.to_string() << std::endl;
assert(stanza.get_inner() == "coucou\r\n");
});
xml.feed(doc2.data(), doc.size(), true);
/**
* XML escape/escape
*/