aboutsummaryrefslogtreecommitdiff
path: root/libsylph/utils.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-05-18 02:26:45 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-05-18 02:26:45 +0000
commitd86665625571fd744f58bdc8e228c3e3545287c0 (patch)
tree63e38313c8d050547510da62d78412ef0c2d3517 /libsylph/utils.c
parent17f520fefb4f4c8c9715cf30f7e0062567132428 (diff)
URI encode mailto: to protect '+'.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1709 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/utils.c')
-rw-r--r--libsylph/utils.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libsylph/utils.c b/libsylph/utils.c
index 56e7fccd..0379342b 100644
--- a/libsylph/utils.c
+++ b/libsylph/utils.c
@@ -1845,6 +1845,26 @@ gchar *uriencode_for_filename(const gchar *filename)
return enc;
}
+gchar *uriencode_for_mailto(const gchar *mailto)
+{
+ const gchar *p = mailto;
+ gchar *enc, *outp;
+
+ outp = enc = g_malloc(strlen(mailto) * 3 + 1);
+
+ for (p = mailto; *p != '\0'; p++) {
+ if (*p == '+') {
+ *outp++ = '%';
+ get_hex_str(outp, *p);
+ outp += 2;
+ } else
+ *outp++ = *p;
+ }
+
+ *outp = '\0';
+ return enc;
+}
+
gint scan_mailto_url(const gchar *mailto, gchar **to, gchar **cc, gchar **bcc,
gchar **subject, gchar **inreplyto, gchar **body)
{