changeset 24756:ced7ff727a97

Fix bugs sending and receiving myspace IMs related to not escaping HTML when displaying incoming messages and sending outgoing messages. For example, if we receive "test1 < test2" then the "test2" gets dropped. I really don't see why this is needed... I thought the data in xmlnodes was escaped. Whatever.
author Mark Doliner <mark@kingant.net>
date Wed, 17 Dec 2008 03:33:57 +0000
parents 9ca3ddf937f2
children cd0071208174
files libpurple/protocols/myspace/markup.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/markup.c	Wed Dec 17 03:03:36 2008 +0000
+++ b/libpurple/protocols/myspace/markup.c	Wed Dec 17 03:33:57 2008 +0000
@@ -550,7 +550,7 @@
 msim_convert_xmlnode(MsimSession *session, GString *out, xmlnode *root, MSIM_XMLNODE_CONVERT f, int nodes_processed)
 {
 	xmlnode *node;
-	gchar *begin, *inner, *end;
+	gchar *begin, *inner, *end, *tmp;
 	int descended = nodes_processed;
 
 	if (!root || !root->name)
@@ -584,7 +584,13 @@
 
 			case XMLNODE_TYPE_DATA:
 				/* Literal text. */
-				g_string_append_len(out, node->data, node->data_sz);
+				/*
+				 * TODO: Why is it necessary to escape here?  I thought
+				 *       node->data was already escaped?
+				 */
+				tmp = g_markup_escape_text(node->data, node->data_sz);
+				g_string_append(out, tmp);
+				g_free(tmp);
 				break;
 
 			default: