X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_params.c;h=7dbffb98d72b08584d19bd77c149861491d5923b;hb=758d5ececf52a621e3658b0b2a78c69bd5eec7e4;hp=1be8e55ecd1b5baa34e70a252cb97f60d63454e5;hpb=16ecea28f2bbcf20d69dedc6611a959923720656;p=m6w6%2Fext-http diff --git a/php_http_params.c b/php_http_params.c index 1be8e55..7dbffb9 100644 --- a/php_http_params.c +++ b/php_http_params.c @@ -60,14 +60,14 @@ static inline void sanitize_escaped(zval *zv) ZVAL_STR(zv, php_http_cs2zs(deq, deq_len)); } - php_stripcslashes(Z_STRVAL_P(zv), &Z_STRLEN_P(zv)); + php_stripcslashes(Z_STR_P(zv)); } static inline void prepare_escaped(zval *zv) { if (Z_TYPE_P(zv) == IS_STRING) { size_t len = Z_STRLEN_P(zv); - zend_string *stripped = php_addcslashes(Z_STRVAL_P(zv), Z_STRLEN_P(zv), 0, + zend_string *stripped = php_addcslashes(Z_STR_P(zv), 0, ZEND_STRL("\0..\37\173\\\"")); if (len != stripped->len || strpbrk(stripped->val, "()<>@,;:\"[]?={} ")) { @@ -445,9 +445,12 @@ static void merge_param(HashTable *params, zval *zdata, zval **current_param, zv if (Z_TYPE_P(test_ptr) == IS_ARRAY) { /* now find key in ptr */ if (HASH_KEY_IS_STRING == zend_hash_get_current_key(Z_ARRVAL_P(zdata_ptr), &hkey.key, &hkey.h)) { + zval *tmp_ptr = ptr; + if ((ptr = zend_hash_find(Z_ARRVAL_P(ptr), hkey.key))) { zdata_ptr = test_ptr; } else { + ptr = tmp_ptr; Z_TRY_ADDREF_P(test_ptr); ptr = zend_hash_update(Z_ARRVAL_P(ptr), hkey.key, test_ptr); break;