aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-utils.c
diff options
context:
space:
mode:
authorSuman Manjunath <msuman@src.gnome.org>2009-01-13 11:41:19 +0800
committerSuman Manjunath <msuman@src.gnome.org>2009-01-13 11:41:19 +0800
commit84aa765a197eacbb8e09fc0af2e1e00937ae6178 (patch)
tree22518ef0a77615fac5bbe695b2443f77fe69b8ae /mail/em-utils.c
parent1df00c7d517794881faefd45b3ae230a6b0d8204 (diff)
downloadgsoc2013-evolution-84aa765a197eacbb8e09fc0af2e1e00937ae6178.tar.gz
gsoc2013-evolution-84aa765a197eacbb8e09fc0af2e1e00937ae6178.tar.zst
gsoc2013-evolution-84aa765a197eacbb8e09fc0af2e1e00937ae6178.zip
Patch from Felix Riemann <friemann@svn.gnome.org> ** Fix for bug #563867 (Unescape "&amp;" when passing the link to browsers).
svn path=/trunk/; revision=37063
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r--mail/em-utils.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c
index bb92d7ad03..f65edb0e40 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -2442,3 +2442,34 @@ em_utils_show_info_silent (GtkWidget *widget)
g_signal_connect(widget, "response", G_CALLBACK(error_response), NULL);
e_activity_handler_make_error (handler, "mail", E_LOG_WARNINGS, widget);
}
+
+gchar *
+em_utils_url_unescape_amp (const gchar *url)
+{
+ gchar *buff;
+ int i, j, amps;
+
+ if (!url)
+ return NULL;
+
+ amps = 0;
+ for (i = 0; url [i]; i++) {
+ if (url [i] == '&' && strncmp (url + i, "&amp;", 5) == 0)
+ amps++;
+ }
+
+ buff = g_strdup (url);
+
+ if (!amps)
+ return buff;
+
+ for (i = 0, j = 0; url [i]; i++, j++) {
+ buff [j] = url [i];
+
+ if (url [i] == '&' && strncmp (url + i, "&amp;", 5) == 0)
+ i += 4;
+ }
+ buff [j] = 0;
+
+ return buff;
+}