X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_url_api.c;fp=http_url_api.c;h=fb7f0ae74f3581149ea811bb7a27362bf23f0553;hp=60fc11ffb19e086b114a64e10f3a471a2f1cdb0e;hb=d309416dd166624d97ee795bd87ee5b06714f932;hpb=096937185b5e249341eec6899ef35462034895be diff --git a/http_url_api.c b/http_url_api.c index 60fc11f..fb7f0ae 100644 --- a/http_url_api.c +++ b/http_url_api.c @@ -391,6 +391,10 @@ PHP_HTTP_API STATUS _http_urlencode_hash_recursive(HashTable *ht, phpstr *str, c } if (key) { + if (!*key) { + /* only public properties */ + continue; + } if (len && key[len - 1] == '\0') { --len; } @@ -416,10 +420,10 @@ PHP_HTTP_API STATUS _http_urlencode_hash_recursive(HashTable *ht, phpstr *str, c phpstr_fix(&new_prefix); } - if (Z_TYPE_PP(data) == IS_ARRAY) { + if (Z_TYPE_PP(data) == IS_ARRAY || Z_TYPE_PP(data) == IS_OBJECT) { STATUS status; ++ht->nApplyCount; - status = http_urlencode_hash_recursive(Z_ARRVAL_PP(data), str, arg_sep, arg_sep_len, PHPSTR_VAL(&new_prefix), PHPSTR_LEN(&new_prefix)); + status = http_urlencode_hash_recursive(HASH_OF(*data), str, arg_sep, arg_sep_len, PHPSTR_VAL(&new_prefix), PHPSTR_LEN(&new_prefix)); --ht->nApplyCount; if (SUCCESS != status) { phpstr_dtor(&new_prefix);