X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_querystring_api.c;h=4c45664b5aacbdcf982a32ef866c67719a2945b5;hp=45aa5acc7666a26cbe5575cbbd1312ce5fac9ebe;hb=9c3bc2cb7b5217a91a8defbbe7c5c20f33938d59;hpb=4b8791e9f6d428df211275429051c465a2f3b12b diff --git a/http_querystring_api.c b/http_querystring_api.c index 45aa5ac..4c45664 100644 --- a/http_querystring_api.c +++ b/http_querystring_api.c @@ -16,7 +16,7 @@ #include "php_http.h" #include "php_variables.h" -#ifdef HAVE_ICONV +#ifdef HTTP_HAVE_ICONV # undef PHP_ATOM_INC # include "ext/iconv/php_iconv.h" # include "ext/standard/url.h" @@ -38,7 +38,7 @@ static inline int _http_querystring_modify_array_ex(zval *qarray, int key_type, static inline int _http_querystring_modify_array(zval *qarray, zval *params TSRMLS_DC); -#ifdef HAVE_ICONV +#ifdef HTTP_HAVE_ICONV PHP_HTTP_API int _http_querystring_xlate(zval *array, zval *param, const char *ie, const char *oe TSRMLS_DC) { HashPosition pos; @@ -154,7 +154,8 @@ static inline int _http_querystring_modify_array(zval *qarray, zval *params TSRM zval **params_entry = NULL; FOREACH_KEYLENVAL(pos, params, key, keylen, idx, params_entry) { - if (http_querystring_modify_array_ex(qarray, key ? HASH_KEY_IS_STRING : HASH_KEY_IS_LONG, key, keylen, idx, *params_entry)) { + /* only public properties */ + if ((!key || *key) && http_querystring_modify_array_ex(qarray, key ? HASH_KEY_IS_STRING : HASH_KEY_IS_LONG, key, keylen, idx, *params_entry)) { rv = 1; } key = NULL; @@ -182,8 +183,8 @@ static inline int _http_querystring_modify_array_ex(zval *qarray, int key_type, zval equal; /* recursive */ - if (Z_TYPE_P(params_entry) == IS_ARRAY) { - return http_querystring_modify_array(*qarray_entry, params_entry); + if (Z_TYPE_P(params_entry) == IS_ARRAY || Z_TYPE_P(params_entry) == IS_OBJECT) { + return http_querystring_modify(*qarray_entry, params_entry); } /* equal */ if ((SUCCESS == is_equal_function(&equal, *qarray_entry, params_entry TSRMLS_CC)) && Z_BVAL(equal)) { @@ -193,6 +194,9 @@ static inline int _http_querystring_modify_array_ex(zval *qarray, int key_type, /* add */ ZVAL_ADDREF(params_entry); + if (Z_TYPE_P(params_entry) == IS_OBJECT) { + convert_to_array_ex(¶ms_entry); + } if (key_type == HASH_KEY_IS_STRING) { add_assoc_zval_ex(qarray, key, keylen, params_entry); } else {