X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_api.c;h=4fa8c3d5b703203f92b84c083e421500bc7f8a9b;hp=77b11348c0a0bfc484d3120de9dcb2b1a08ab12b;hb=f12e0c5ab62139e372a4ca509637dc458e7c9cb4;hpb=78145de6c3c0a6b7543c5b3e4d45a321c6defe75 diff --git a/http_api.c b/http_api.c index 77b1134..4fa8c3d 100644 --- a/http_api.c +++ b/http_api.c @@ -549,15 +549,6 @@ PHP_HTTP_API STATUS _http_parse_params_ex(const char *param, int flags, http_par goto failure; break; - case '=': - if (key) { - keylen = c - key; - st = ST_VALUE; - } else { - goto failure; - } - break; - case ' ': if (key) { keylen = c - key; @@ -574,7 +565,32 @@ PHP_HTTP_API STATUS _http_parse_params_ex(const char *param, int flags, http_par } break; + case ':': + if (!(flags & HTTP_PARAMS_COLON_SEPARATOR)) { + goto not_separator; + } + if (key) { + keylen = c - key; + st = ST_VALUE; + } else { + goto failure; + } + break; + + case '=': + if (flags & HTTP_PARAMS_COLON_SEPARATOR) { + goto not_separator; + } + if (key) { + keylen = c - key; + st = ST_VALUE; + } else { + goto failure; + } + break; + default: + not_separator: if (!key) { key = c; } @@ -646,7 +662,7 @@ failure: /* }}} */ /* {{{ array_join */ -int apply_array_append_func(void *pDest, int num_args, va_list args, zend_hash_key *hash_key) +int apply_array_append_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { int flags; char *key = NULL; @@ -666,10 +682,7 @@ int apply_array_append_func(void *pDest, int num_args, va_list args, zend_hash_k ZVAL_ADDREF(*value); if (data) { - if (Z_TYPE_PP(data) != IS_ARRAY) { - convert_to_array(*data); - } - add_next_index_zval(*data, *value); + add_next_index_zval(http_zset(IS_ARRAY, *data), *value); } else if (key) { zend_hash_add(dst, key, hash_key->nKeyLength, value, sizeof(zval *), NULL); } else { @@ -684,7 +697,7 @@ int apply_array_append_func(void *pDest, int num_args, va_list args, zend_hash_k return ZEND_HASH_APPLY_KEEP; } -int apply_array_merge_func(void *pDest, int num_args, va_list args, zend_hash_key *hash_key) +int apply_array_merge_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { int flags; char *key = NULL;