Skip to content

Commit 978cdb7

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fixed bug #79741
2 parents c5caa05 + 43cd3f6 commit 978cdb7

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

ext/curl/interface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,7 @@ static inline int build_mime_structure_from_hash(php_curl *ch, zval *zpostfields
21832183
}
21842184
#endif
21852185

2186-
ZEND_HASH_FOREACH_KEY_VAL(postfields, num_key, string_key, current) {
2186+
ZEND_HASH_FOREACH_KEY_VAL_IND(postfields, num_key, string_key, current) {
21872187
zend_string *postval, *tmp_postval;
21882188
/* Pretend we have a string_key here */
21892189
if (!string_key) {
@@ -2919,7 +2919,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
29192919
return FAILURE;
29202920
}
29212921

2922-
ZEND_HASH_FOREACH_VAL(ph, current) {
2922+
ZEND_HASH_FOREACH_VAL_IND(ph, current) {
29232923
ZVAL_DEREF(current);
29242924
val = zval_get_tmp_string(current, &tmp_val);
29252925
slist = curl_slist_append(slist, ZSTR_VAL(val));

ext/curl/tests/bug79741.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Bug #79741: curl_setopt CURLOPT_POSTFIELDS asserts on object with declared properties
3+
--FILE--
4+
<?php
5+
6+
class Test {
7+
public $prop = "value";
8+
}
9+
10+
$ch = curl_init();
11+
curl_setopt($ch, CURLOPT_POSTFIELDS, new Test);
12+
13+
?>
14+
===DONE===
15+
--EXPECT--
16+
===DONE===

0 commit comments

Comments
 (0)