diff options
author | Alban Browaeys <prahal@yahoo.com> | 2013-09-23 15:12:25 +0200 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2013-09-24 10:53:00 -0400 |
commit | 3acda7636ad2e116397aab913f6d8bb8f609715a (patch) | |
tree | 04733d03296a76ba7f935546c55b144e372fe1e0 | |
parent | 9c09d4592df0073dbf5e52e6f5c4e1460067b967 (diff) | |
download | libsoup-3acda7636ad2e116397aab913f6d8bb8f609715a.tar.gz |
append_form_encoded: sync urlencode with php RFC1738 implementation.
From php_url_encode:
/* Allow only alphanumeric chars and '_', '-', '.'; escape the rest */
https://bugzilla.gnome.org/show_bug.cgi?id=708621
-rw-r--r-- | libsoup/soup-form.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libsoup/soup-form.c b/libsoup/soup-form.c index 5946daeb..4dee5647 100644 --- a/libsoup/soup-form.c +++ b/libsoup/soup-form.c @@ -218,7 +218,8 @@ append_form_encoded (GString *str, const char *in) if (*s == ' ') { g_string_append_c (str, '+'); s++; - } else if (!g_ascii_isalnum (*s)) + } else if (!g_ascii_isalnum (*s) && (*s != '-') && (*s != '_') + && (*s != '.')) g_string_append_printf (str, "%%%02X", (int)*s++); else g_string_append_c (str, *s++); |