[libsoup] append_form_encoded: sync urlencode with php RFC1738 implementation.
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] append_form_encoded: sync urlencode with php RFC1738 implementation.
- Date: Tue, 24 Sep 2013 14:53:38 +0000 (UTC)
commit 3acda7636ad2e116397aab913f6d8bb8f609715a
Author: Alban Browaeys <prahal yahoo com>
Date: Mon Sep 23 15:12:25 2013 +0200
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
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 5946dae..4dee564 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++);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]