changeset 26507:c5920a8cf83f

encode urls passed to tinyurl
author Richard Nelson <wabz@pidgin.im>
date Tue, 07 Apr 2009 23:26:33 +0000
parents 1a94a964bddf
children bf5b74b2a483 865ed80b17e1
files finch/plugins/gnttinyurl.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/finch/plugins/gnttinyurl.c	Tue Apr 07 05:28:58 2009 +0000
+++ b/finch/plugins/gnttinyurl.c	Tue Apr 07 23:26:33 2009 +0000
@@ -293,9 +293,9 @@
 		cbdata->conv = conv;
 		tmp = purple_unescape_html((char *)iter->data);
 		if (g_ascii_strncasecmp(tmp, "http://", 7) && g_ascii_strncasecmp(tmp, "https://", 8)) {
-			url = g_strdup_printf("%shttp://%s", purple_prefs_get_string(PREF_URL), tmp);
+			url = g_strdup_printf("%shttp%%3A%%2F%%2F%s", purple_prefs_get_string(PREF_URL), purple_url_encode(tmp));
 		} else {
-			url = g_strdup_printf("%s%s", purple_prefs_get_string(PREF_URL), tmp);
+			url = g_strdup_printf("%s%s", purple_prefs_get_string(PREF_URL), purple_url_encode(tmp));
 		}
 		g_free(tmp);
 		purple_util_fetch_url(url, TRUE, "finch", FALSE, url_fetched, cbdata);