diff libpurple/util.c @ 27066:d2424873c666

propagate from branch 'im.pidgin.pidgin' (head 36e85b01808a3c6e32116cb8b71b10e31b0da072) to branch 'im.pidgin.cpw.malu.client_type' (head 23d0d225ef28e21781c194b5c243757309028a55)
author Marcus Lundblad <ml@update.uu.se>
date Sun, 17 May 2009 19:04:15 +0000
parents 6ddb4932772a
children f303787f144d c2ac87c5a035
line wrap: on
line diff
--- a/libpurple/util.c	Wed May 13 20:37:46 2009 +0000
+++ b/libpurple/util.c	Sun May 17 19:04:15 2009 +0000
@@ -129,7 +129,7 @@
 	ascii = g_malloc(len * 2 + 1);
 
 	for (i = 0; i < len; i++)
-		snprintf(&ascii[i * 2], 3, "%02hhx", data[i]);
+		g_snprintf(&ascii[i * 2], 3, "%02hhx", data[i]);
 
 	return ascii;
 }
@@ -1623,7 +1623,7 @@
 					pt->dest_tag = "a";
 					tags = g_list_prepend(tags, pt);
 					if(xhtml)
-						g_string_append_printf(xhtml, "<a href='%s'>", url ? g_strstrip(url->str) : "");
+						g_string_append_printf(xhtml, "<a href=\"%s\">", url ? g_strstrip(url->str) : "");
 					continue;
 				}
 				if(!g_ascii_strncasecmp(c, "<font", 5) && (*(c+5) == '>' || *(c+5) == ' ')) {
@@ -2017,7 +2017,6 @@
 	case '<':
 	case '>':
 	case '"':
-	case '\'':
 		return TRUE;
 	default:
 		return FALSE;
@@ -3920,7 +3919,10 @@
 		}
 	}
 
-	purple_debug_misc("util", "Request: '%s'\n", gfud->request);
+	if(g_getenv("PURPLE_UNSAFE_DEBUG"))
+		purple_debug_misc("util", "Request: '%s'\n", gfud->request);
+	else
+		purple_debug_misc("util", "request constructed\n");
 
 	total_len = strlen(gfud->request);
 
@@ -4023,9 +4025,12 @@
 	g_return_val_if_fail(url      != NULL, NULL);
 	g_return_val_if_fail(callback != NULL, NULL);
 
-	purple_debug_info("util",
-			 "requested to fetch (%s), full=%d, user_agent=(%s), http11=%d\n",
-			 url, full, user_agent?user_agent:"(null)", http11);
+	if(g_getenv("PURPLE_UNSAFE_DEBUG"))
+		purple_debug_info("util",
+				 "requested to fetch (%s), full=%d, user_agent=(%s), http11=%d\n",
+				 url, full, user_agent?user_agent:"(null)", http11);
+	else
+		purple_debug_info("util", "requesting to fetch a URL\n");
 
 	gfud = g_new0(PurpleUtilFetchUrlData, 1);