mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
ext/curl: Use Z_ARRVAL_P instead of HASH_OF
We already check in advance that it is an array
This commit is contained in:
parent
23b8d64cf7
commit
53df3ae1e5
1 changed files with 2 additions and 2 deletions
|
@ -1540,7 +1540,7 @@ static inline zend_result build_mime_structure_from_hash(php_curl *ch, zval *zpo
|
||||||
if (Z_TYPE_P(current) == IS_ARRAY) {
|
if (Z_TYPE_P(current) == IS_ARRAY) {
|
||||||
zval *current_element;
|
zval *current_element;
|
||||||
|
|
||||||
ZEND_HASH_FOREACH_VAL(HASH_OF(current), current_element) {
|
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(current), current_element) {
|
||||||
add_simple_field(mime, string_key, current_element);
|
add_simple_field(mime, string_key, current_element);
|
||||||
} ZEND_HASH_FOREACH_END();
|
} ZEND_HASH_FOREACH_END();
|
||||||
|
|
||||||
|
@ -2186,7 +2186,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
|
||||||
|
|
||||||
case CURLOPT_POSTFIELDS:
|
case CURLOPT_POSTFIELDS:
|
||||||
if (Z_TYPE_P(zvalue) == IS_ARRAY) {
|
if (Z_TYPE_P(zvalue) == IS_ARRAY) {
|
||||||
if (zend_hash_num_elements(HASH_OF(zvalue)) == 0) {
|
if (zend_hash_num_elements(Z_ARRVAL_P(zvalue)) == 0) {
|
||||||
/* no need to build the mime structure for empty hashtables;
|
/* no need to build the mime structure for empty hashtables;
|
||||||
also works around https://github.com/curl/curl/issues/6455 */
|
also works around https://github.com/curl/curl/issues/6455 */
|
||||||
curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, "");
|
curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, "");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue