From 3d9dd93a1452e28c728483b03e352691238491ed Mon Sep 17 00:00:00 2001 From: Joshua Oreman Date: Tue, 29 Dec 2009 22:36:04 -0500 Subject: [uri] Decode/encode URIs when parsing/unparsing Currently, handling of URI escapes is ad-hoc; escaped strings are stored as-is in the URI structure, and it is up to the individual protocol to unescape as necessary. This is error-prone and expensive in terms of code size. Modify this behavior by unescaping in parse_uri() and escaping in unparse_uri() those fields that typically handle URI escapes (hostname, user, password, path, query, fragment), and allowing unparse_uri() to accept a subset of fields to print so it can be easily used to generate e.g. the escaped HTTP path?query request. Signed-off-by: Joshua Oreman Signed-off-by: Marty Connor --- src/core/settings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/settings.c') diff --git a/src/core/settings.c b/src/core/settings.c index fe67d6b72..2fefdb908 100644 --- a/src/core/settings.c +++ b/src/core/settings.c @@ -1085,7 +1085,7 @@ static int fetchf_uristring ( struct settings *settings, fetch_string_setting ( settings, setting, raw_buf, sizeof ( raw_buf ) ); - return uri_encode ( raw_buf, buf, len ); + return uri_encode ( raw_buf, buf, len, URI_FRAGMENT ); } } -- cgit v1.2.3-55-g7522