X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_api.c;h=4fa8c3d5b703203f92b84c083e421500bc7f8a9b;hp=b54da54d2f0149395760dfa5746bcb2f989c9cff;hb=5ba379899fb1e05ede73674dc010ce8846e051c2;hpb=3790a41ee6c48417d9570ec507e6490bcde0736f diff --git a/http_api.c b/http_api.c index b54da54..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; } @@ -666,10 +682,7 @@ int apply_array_append_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, 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 {