X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_functions.c;h=7d82438ef6e059f52465c1343dac139d46545ca0;hp=5ff5e33a7eff753d79771b9ade894f1a98c3dde0;hb=0fba8595e6e2de88cad39460340d620a089c55ed;hpb=f74f04a864158aae028a863b4af09c45247a044e diff --git a/http_functions.c b/http_functions.c index 5ff5e33..7d82438 100644 --- a/http_functions.c +++ b/http_functions.c @@ -1381,21 +1381,17 @@ PHP_FUNCTION(http_build_query) int prefix_len = 0, arg_sep_len = strlen(arg_sep); phpstr *formstr; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ss", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len) != SUCCESS) { - RETURN_FALSE; - } - - if (Z_TYPE_P(formdata) != IS_ARRAY && Z_TYPE_P(formdata) != IS_OBJECT) { - http_error(HE_WARNING, HTTP_E_INVALID_PARAM, "Parameter 1 expected to be Array or Object. Incorrect value given."); + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|ss", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len) != SUCCESS) { RETURN_FALSE; } if (!arg_sep_len) { arg_sep = HTTP_URL_ARGSEP; + arg_sep_len = lenof(HTTP_URL_ARGSEP); } formstr = phpstr_new(); - if (SUCCESS != http_urlencode_hash_implementation_ex(HASH_OF(formdata), formstr, arg_sep, prefix, prefix_len, NULL, 0, NULL, 0, (Z_TYPE_P(formdata) == IS_OBJECT ? formdata : NULL))) { + if (SUCCESS != http_urlencode_hash_recursive(HASH_OF(formdata), formstr, arg_sep, prefix, prefix_len)) { phpstr_free(&formstr); RETURN_FALSE; }