changeset 23446:f1f5efd679a4

Patch 4 from Qulogic, this one fixes a group name escape bug introduced by patch 3 committer: Ka-Hing Cheung <khc@hxbc.us>
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Wed, 26 Dec 2007 00:35:26 +0000
parents b70f30dd4753
children 72aa2ccad28d
files libpurple/protocols/msn/contact.c
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Wed Dec 26 00:34:50 2007 +0000
+++ b/libpurple/protocols/msn/contact.c	Wed Dec 26 00:35:26 2007 +0000
@@ -1370,6 +1370,7 @@
 msn_add_group(MsnSession *session, MsnCallbackState *state, const char* group_name)
 {
 	char *body = NULL;
+	char *escaped_group_name = NULL;
 
 	g_return_if_fail(session != NULL);
 	g_return_if_fail(group_name != NULL);
@@ -1386,9 +1387,11 @@
 	/* escape group name's html special chars so it can safely be sent
 	* in a XML SOAP request
 	*/
-	body = g_markup_printf_escaped(MSN_GROUP_ADD_TEMPLATE,
-	                               msn_contact_get_token(session->contact),
-	                               group_name);
+	escaped_group_name = g_markup_escape_text(group_name, -1);
+	body = g_strdup_printf(MSN_GROUP_ADD_TEMPLATE,
+	                       msn_contact_get_token(session->contact),
+	                       escaped_group_name);
+	g_free(escaped_group_name);
 
 	msn_soap_message_send(session,
 		msn_soap_message_new(MSN_GROUP_ADD_SOAP_ACTION,
@@ -1451,6 +1454,7 @@
 	gchar *body = NULL;
 	const gchar * guid;
 	MsnCallbackState *state;
+	char *escaped_group_name;
 	
 	g_return_if_fail(session != NULL);
 	g_return_if_fail(session->userlist != NULL);
@@ -1474,9 +1478,11 @@
 
 	msn_callback_state_set_action(state, MSN_RENAME_GROUP);
 	
-	body = g_markup_printf_escaped(MSN_GROUP_RENAME_TEMPLATE,
-	                               msn_contact_get_token(session->contact),
-	                               guid, new_group_name);
+	escaped_group_name = g_markup_escape_text(new_group_name, -1);
+	body = g_strdup_printf(MSN_GROUP_RENAME_TEMPLATE,
+	                       msn_contact_get_token(session->contact),
+	                       guid, escaped_group_name);
+	g_free(escaped_group_name);
 	
 	msn_soap_message_send(session,
 		msn_soap_message_new(MSN_GROUP_RENAME_SOAP_ACTION,