From: Michael Wallner Date: Wed, 8 Mar 2006 21:52:55 +0000 (+0000) Subject: - fix http_build_str(): urlencode [] brackets X-Git-Tag: RELEASE_1_0_0RC1~8 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=fd1cab568f6b0f31c8d670478e65afd390ec12e4;p=m6w6%2Fext-http - fix http_build_str(): urlencode [] brackets --- diff --git a/http_url_api.c b/http_url_api.c index cac64ec..cb0aeb5 100644 --- a/http_url_api.c +++ b/http_url_api.c @@ -385,14 +385,14 @@ PHP_HTTP_API STATUS _http_urlencode_hash_recursive(HashTable *ht, phpstr *str, c phpstr_init(&new_prefix); if (prefix && prefix_len) { phpstr_append(&new_prefix, prefix, prefix_len); - phpstr_appends(&new_prefix, "["); + phpstr_appends(&new_prefix, "%5B"); } phpstr_append(&new_prefix, encoded_key, encoded_len); efree(encoded_key); if (prefix && prefix_len) { - phpstr_appends(&new_prefix, "]"); + phpstr_appends(&new_prefix, "%5D"); } phpstr_fix(&new_prefix); } diff --git a/package2.xml b/package2.xml index 499d790..a62cff8 100644 --- a/package2.xml +++ b/package2.xml @@ -47,6 +47,7 @@ HttpResponse BSD, revised diff --git a/tests/build_str_001.phpt b/tests/build_str_001.phpt index 9bd0f40..8aeafcc 100644 --- a/tests/build_str_001.phpt +++ b/tests/build_str_001.phpt @@ -8,23 +8,23 @@ include 'skip.inc'; --EXPECTF-- %sTEST -bool(true) -bool(true) -bool(true) -bool(true) +a=b +a=b&c%5B0%5D=1 +a=b&c%5B0%5D=1&d%5Be%5D=f +foo%5B0%5D=1&foo%5B1%5D=2&foo%5B2%5D%5B0%5D=3 Done