Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 53df3ae

Browse files
committed
ext/curl: Use Z_ARRVAL_P instead of HASH_OF
We already check in advance that it is an array
1 parent 23b8d64 commit 53df3ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎ext/curl/interface.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,7 +1540,7 @@ static inline zend_result build_mime_structure_from_hash(php_curl *ch, zval *zpo
15401540
if (Z_TYPE_P(current) == IS_ARRAY) {
15411541
zval *current_element;
15421542

1543-
ZEND_HASH_FOREACH_VAL(HASH_OF(current), current_element) {
1543+
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(current), current_element) {
15441544
add_simple_field(mime, string_key, current_element);
15451545
} ZEND_HASH_FOREACH_END();
15461546

@@ -2186,7 +2186,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
21862186

21872187
case CURLOPT_POSTFIELDS:
21882188
if (Z_TYPE_P(zvalue) == IS_ARRAY) {
2189-
if (zend_hash_num_elements(HASH_OF(zvalue)) == 0) {
2189+
if (zend_hash_num_elements(Z_ARRVAL_P(zvalue)) == 0) {
21902190
/* no need to build the mime structure for empty hashtables;
21912191
also works around https://github.com/curl/curl/issues/6455 */
21922192
curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, "");

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /