Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79741
This commit is contained in:
Nikita Popov 2020-06-26 12:29:43 +02:00
commit f930978b70
2 changed files with 18 additions and 2 deletions

View file

@ -2046,7 +2046,7 @@ static inline int build_mime_structure_from_hash(php_curl *ch, zval *zpostfields
}
#endif
ZEND_HASH_FOREACH_KEY_VAL(postfields, num_key, string_key, current) {
ZEND_HASH_FOREACH_KEY_VAL_IND(postfields, num_key, string_key, current) {
zend_string *postval, *tmp_postval;
/* Pretend we have a string_key here */
if (!string_key) {
@ -2702,7 +2702,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
return FAILURE;
}
ZEND_HASH_FOREACH_VAL(ph, current) {
ZEND_HASH_FOREACH_VAL_IND(ph, current) {
ZVAL_DEREF(current);
val = zval_get_tmp_string(current, &tmp_val);
slist = curl_slist_append(slist, ZSTR_VAL(val));

View file

@ -0,0 +1,16 @@
--TEST--
Bug #79741: curl_setopt CURLOPT_POSTFIELDS asserts on object with declared properties
--FILE--
<?php
class Test {
public $prop = "value";
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS, new Test);
?>
===DONE===
--EXPECT--
===DONE===