Skip to content

Commit f930978

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fixed bug #79741
2 parents 1cbb62e + 978cdb7 commit f930978

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
@@ -2046,7 +2046,7 @@ static inline int build_mime_structure_from_hash(php_curl *ch, zval *zpostfields
20462046
}
20472047
#endif
20482048

2049-
ZEND_HASH_FOREACH_KEY_VAL(postfields, num_key, string_key, current) {
2049+
ZEND_HASH_FOREACH_KEY_VAL_IND(postfields, num_key, string_key, current) {
20502050
zend_string *postval, *tmp_postval;
20512051
/* Pretend we have a string_key here */
20522052
if (!string_key) {
@@ -2702,7 +2702,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
27022702
return FAILURE;
27032703
}
27042704

2705-
ZEND_HASH_FOREACH_VAL(ph, current) {
2705+
ZEND_HASH_FOREACH_VAL_IND(ph, current) {
27062706
ZVAL_DEREF(current);
27072707
val = zval_get_tmp_string(current, &tmp_val);
27082708
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)