Skip to content

Commit 43cd3f6

Browse files
committed
Fixed bug #79741
1 parent 4a26628 commit 43cd3f6

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ PHP NEWS
66
. Fixed bug #79030 (Upgrade apache2handler's php_apache_sapi_get_request_time
77
to return usec). (Herbert256)
88

9+
- Curl:
10+
. Fixed bug #79741 (curl_setopt CURLOPT_POSTFIELDS asserts on object with
11+
declared properties). (Nikita)
12+
913
- FTP:
1014
. Fixed bug #55857 (ftp_size on large files). (cmb)
1115

ext/curl/interface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,7 +2719,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
27192719
return FAILURE;
27202720
}
27212721

2722-
ZEND_HASH_FOREACH_VAL(ph, current) {
2722+
ZEND_HASH_FOREACH_VAL_IND(ph, current) {
27232723
ZVAL_DEREF(current);
27242724
val = zval_get_tmp_string(current, &tmp_val);
27252725
slist = curl_slist_append(slist, ZSTR_VAL(val));
@@ -2797,7 +2797,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
27972797
}
27982798
#endif
27992799

2800-
ZEND_HASH_FOREACH_KEY_VAL(postfields, num_key, string_key, current) {
2800+
ZEND_HASH_FOREACH_KEY_VAL_IND(postfields, num_key, string_key, current) {
28012801
zend_string *postval, *tmp_postval;
28022802
/* Pretend we have a string_key here */
28032803
if (!string_key) {

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)