pidgin: a980e77e: Fix bugs sending and receiving myspace I...

markdoliner at pidgin.im markdoliner at pidgin.im
Tue Dec 16 22:35:41 EST 2008


-----------------------------------------------------------------
Revision: a980e77e2c15cf8a2c8f373d7aa1b102bd6952f3
Ancestor: 2be96aaa1f7eef229c319aba0734e2dc40a9021f
Author: markdoliner at pidgin.im
Date: 2008-12-17T03:33:57
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a980e77e2c15cf8a2c8f373d7aa1b102bd6952f3

Modified files:
        libpurple/protocols/myspace/markup.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- libpurple/protocols/myspace/markup.c	780772f513c21e7424f5ca6b657a6e37edfcb15d
+++ libpurple/protocols/myspace/markup.c	a8106fd035d8eedeca4a37ac847d5a343f18ac3e
@@ -550,7 +550,7 @@ msim_convert_xmlnode(MsimSession *sessio
 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 @@ msim_convert_xmlnode(MsimSession *sessio
 
 			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:


More information about the Commits mailing list