#include "php_http.h"
#include "php_variables.h"
-#ifdef HAVE_ICONV && !HTTP_SHARED_EXT(ICONV)
+#ifdef HTTP_HAVE_ICONV
# undef PHP_ATOM_INC
# include "ext/iconv/php_iconv.h"
# include "ext/standard/url.h"
static inline int _http_querystring_modify_array(zval *qarray, zval *params TSRMLS_DC);
-#ifdef HAVE_ICONV && !HTTP_SHARED_EXT(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;
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;
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)) {
/* 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 {