File tree Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ PHP NEWS
8
8
. The __sleep() and __wakeup() magic methods have been deprecated. (Girgias)
9
9
. Fixed hard_timeout with --enable-zend-max-execution-timers. (Appla)
10
10
11
+ - Curl:
12
+ . Fix cloning of CURLOPT_POSTFIELDS when using the clone operator instead
13
+ of the curl_copy_handle() function to clone a CurlHandle. (timwolla)
14
+
11
15
- Exif:
12
16
. Fix OSS-Fuzz #442954659 (zero-size box in HEIF file causes infinite loop).
13
17
(nielsdos)
Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ static zend_object *curl_clone_obj(zend_object *object) {
423
423
clone_ch -> cp = cp ;
424
424
_php_setup_easy_copy_handlers (clone_ch , ch );
425
425
426
- postfields = & clone_ch -> postfields ;
426
+ postfields = & ch -> postfields ;
427
427
if (Z_TYPE_P (postfields ) != IS_UNDEF ) {
428
428
if (build_mime_structure_from_hash (clone_ch , postfields ) == FAILURE ) {
429
429
zend_throw_exception (NULL , "Failed to clone CurlHandle" , 0 );
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ clone() allows to post CURLFile multiple times
3
+ --EXTENSIONS--
4
+ curl
5
+ --FILE--
6
+ <?php
7
+ include 'server.inc ' ;
8
+ $ host = curl_cli_server_start ();
9
+
10
+ $ ch1 = curl_init ();
11
+ curl_setopt ($ ch1 , CURLOPT_SAFE_UPLOAD , 1 );
12
+ curl_setopt ($ ch1 , CURLOPT_URL , "{$ host }/get.php?test=file " );
13
+ curl_setopt ($ ch1 , CURLOPT_RETURNTRANSFER , 1 );
14
+
15
+ $ filename = __DIR__ . '/curl_copy_handle_variation3_clone.txt ' ;
16
+ file_put_contents ($ filename , "Test. " );
17
+ $ file = curl_file_create ($ filename );
18
+ $ params = array ('file ' => $ file );
19
+ var_dump (curl_setopt ($ ch1 , CURLOPT_POSTFIELDS , $ params ));
20
+
21
+ $ ch2 = clone ($ ch1 );
22
+
23
+ var_dump (curl_exec ($ ch1 ));
24
+
25
+ var_dump (curl_exec ($ ch2 ));
26
+ ?>
27
+ --EXPECTF--
28
+ bool(true)
29
+ string(%d) "curl_copy_handle_variation3_clone.txt|application/octet-stream|5"
30
+ string(%d) "curl_copy_handle_variation3_clone.txt|application/octet-stream|5"
31
+ --CLEAN--
32
+ <?php
33
+ @unlink (__DIR__ . '/curl_copy_handle_variation3_clone.txt ' );
34
+ ?>
You can’t perform that action at this time.
0 commit comments