summaryrefslogtreecommitdiff
path: root/libsoup/soup-uri.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2010-11-09 12:23:10 -0500
committerDan Winship <danw@gnome.org>2010-11-09 12:23:10 -0500
commit82b45228b517c05c36992ff63bc26e91df473a80 (patch)
treea4d7c914137827fff90878102e264033ce050fb2 /libsoup/soup-uri.c
parent03ba590d895bba7fa47fe545fd5fdef8b6f610b7 (diff)
downloadlibsoup-82b45228b517c05c36992ff63bc26e91df473a80.tar.gz
Fix parsing/generation of URI queries that aren't HTML forms
soup_form_decode() used to accept strings that weren't "name=value" pairs, but soup_form_encode_hash() would crash if you passed the resulting GHashTable to it. Fix both sides: now soup_form_decode() ignores non-"name=value" elements, and soup_form_encode_hash() g_return_if_fail()s rather than crashing. Also fix use of deprecated soup-form.h method names in soup-uri.c and soup-server.c https://bugzilla.gnome.org/show_bug.cgi?id=620220
Diffstat (limited to 'libsoup/soup-uri.c')
-rw-r--r--libsoup/soup-uri.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libsoup/soup-uri.c b/libsoup/soup-uri.c
index 04e87e13..dcffd339 100644
--- a/libsoup/soup-uri.c
+++ b/libsoup/soup-uri.c
@@ -68,7 +68,7 @@
* #SoupURI will have a @path of "/".
*
* @query and @fragment are optional for all URI types.
- * soup_form_decode_urlencoded() may be useful for parsing @query.
+ * soup_form_decode() may be useful for parsing @query.
*
* Note that @path, @query, and @fragment may contain
* %<!-- -->-encoded characters. soup_uri_new() calls
@@ -980,7 +980,8 @@ soup_uri_set_query (SoupURI *uri, const char *query)
/**
* soup_uri_set_query_from_form:
* @uri: a #SoupURI
- * @form: (element-type utf8 utf8): a #GHashTable containing HTML form information
+ * @form: (element-type utf8 utf8): a #GHashTable containing HTML form
+ * information
*
* Sets @uri's query to the result of encoding @form according to the
* HTML form rules. See soup_form_encode_hash() for more information.
@@ -989,7 +990,7 @@ void
soup_uri_set_query_from_form (SoupURI *uri, GHashTable *form)
{
g_free (uri->query);
- uri->query = soup_form_encode_urlencoded (form);
+ uri->query = soup_form_encode_hash (form);
}
/**