1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

702 Commits

Author SHA1 Message Date
ndossche
76445cabc0 Merge branch 'PHP-8.5'
* PHP-8.5:
  curl: Don't truncate length
2026-02-17 23:16:32 +01:00
ndossche
ed4ae182b5 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  curl: Don't truncate length
2026-02-17 23:16:25 +01:00
Niels Dossche
e2059a4697 curl: Don't truncate length
Truncating to an int seems dangerous, esp. in combination with a MIN
macro. I don't see a reason to truncate the length from size_t to int,
and especially no reason to change the signedness.

Closes GH-20747.
2026-02-17 23:15:55 +01:00
Arshid
cdae6c38f6 Return from curl_setopt() with RETURN_BOOL() (GH-21136) 2026-02-05 15:14:52 +01:00
David Carlier
4876148bbe Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21023: CURLOPT_XFERINFOFUNCTION with invalid callback crash.
2026-01-30 13:10:35 +00:00
David Carlier
2b89919a5d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21023: CURLOPT_XFERINFOFUNCTION with invalid callback crash.
2026-01-30 13:10:27 +00:00
David Carlier
b156471a30 Fix GH-21023: CURLOPT_XFERINFOFUNCTION with invalid callback crash.
we check the FCC is properly initialised beforehand in its handler.

close GH-21025
2026-01-30 13:09:44 +00:00
Giovanni Giacobbi
fd0ed00ff3 curl: Deduplicate features array 2026-01-03 18:49:23 +00:00
Giovanni Giacobbi
50af7c7373 curl: Fix coding style 2026-01-03 18:49:23 +00:00
Ilija Tovilo
7a63dcc3ca Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix more curl 8.16 issues
2025-09-23 16:42:31 +02:00
Ilija Tovilo
473ce44108 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix more curl 8.16 issues
2025-09-23 16:22:06 +02:00
Ilija Tovilo
a885372a08 Fix more curl 8.16 issues
The CURLOPT_FOLLOWLOCATION seems like a gcc bug, where the integer extension of
bool to long is lost, but I was unable to reproduce on godbolt.org.
2025-09-23 16:11:19 +02:00
Ilija Tovilo
c79d8b6449 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix curl 8.16.0 compilation with zts
2025-09-22 10:56:51 +02:00
Ilija Tovilo
74cacdd161 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix curl 8.16.0 compilation with zts
2025-09-22 10:56:40 +02:00
Ilija Tovilo
266cb7d892 Fix curl 8.16.0 compilation with zts 2025-09-22 10:55:59 +02:00
Tim Düsterhus
4b6c465588 Implement curl_copy_handle in terms of object cloning (#19841)
This prevents the implementations from going out of sync, causing bugs like
php/php-src#19813.
2025-09-17 17:03:06 +02:00
Niels Dossche
dd27cedddb Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix curl build failure on macOS+curl 8.16
2025-09-13 23:24:31 +02:00
Niels Dossche
8e1df69d34 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix curl build failure on macOS+curl 8.16
2025-09-13 23:24:22 +02:00
Niels Dossche
b46681d686 Fix curl build failure on macOS+curl 8.16
Closes GH-19820.
2025-09-13 23:22:22 +02:00
Tim Düsterhus
82e998559e Merge branch 'PHP-8.4'
* PHP-8.4:
  curl: Fix cloning of POST fields (#19813)
2025-09-12 20:56:12 +02:00
Tim Düsterhus
a94f00adc7 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  curl: Fix cloning of POST fields (#19813)
2025-09-12 20:53:48 +02:00
Tim Düsterhus
871fe600c2 curl: Fix cloning of POST fields (#19813) 2025-09-12 20:53:14 +02:00
Ayesh Karunaratne
6f3bc59950 ext/curl: Add CURLOPT_SSL_SIGNATURE_ALGORITHMS option
Adds support for `CURLOPT_SSL_SIGNATURE_ALGORITHMS`[^1], supported
since Curl version 8.14.0.

[^1]: https://curl.se/libcurl/c/CURLOPT_SSL_SIGNATURE_ALGORITHMS.html

Closes GH-18692
2025-07-26 20:17:05 +02:00
Emre Çalışkan
7fb6afbe9f Add support for CURLINFO_QUEUE_TIME_T in curl_getinfo() (#19147)
This patch adds support for the CURLINFO_QUEUE_TIME_T constant in the
curl_getinfo() function when compiled with libcurl >= 8.6.0.

CURLINFO_QUEUE_TIME_T This constant allows retrieving the time (in
microseconds) that the request spent in libcurl’s connection queue
before it was sent.
2025-07-17 14:56:07 +02:00
Emre Çalışkan
e84320ad75 Add support for CURLINFO_CONN_ID in curl_getinfo() (#18984)
This patch adds support for the CURLINFO_CONN_ID constant in the curl_getinfo() function when compiled with libcurl >= 8.2.0.

CURLINFO_CONN_ID allows retrieving the unique identifier of the underlying connection used in the most recent transfer. This is useful for advanced features like connection reuse tracking, diagnostics, or connection pooling implementations at the PHP level.
2025-07-16 11:08:19 +02:00
Jakub Zelenka
2ecafd41ba Remove curl OpenSSL locking for unsupported versions (#18784) 2025-07-16 11:06:21 +02:00
Niels Dossche
51149b65ad Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-18990, bug #81029, bug #47314: SOAP HTTP socket not closing on object destruction
  Fix leak when path is too long in ZipArchive::extractTo()
  curl: Remove incorrect string release on error
2025-07-02 18:47:53 +02:00
Niels Dossche
764154dc75 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-18990, bug #81029, bug #47314: SOAP HTTP socket not closing on object destruction
  Fix leak when path is too long in ZipArchive::extractTo()
  curl: Remove incorrect string release on error
2025-07-02 18:46:37 +02:00
Niels Dossche
11ea995ff3 curl: Remove incorrect string release on error
The string is owned by the caller, and the caller releases it.

Closes GH-18989.
2025-07-02 18:42:50 +02:00
DanielEScherzer
171501b93f Replace @deprecated with #[\Deprecated] for internal constants (#18780)
Only covers constants declared via stub files, others will be handled
separately in a later commit.

Does not include the intl extension, since that had some errors relating to the
cpp code; that extension will be updated separately.
2025-06-26 11:27:15 -07:00
Niels Dossche
89be689f77 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix memory leaks when returning refcounted value from curl callback
2025-06-21 00:37:57 +02:00
Niels Dossche
ca487ae131 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix memory leaks when returning refcounted value from curl callback
2025-06-21 00:37:51 +02:00
Niels Dossche
c6b058b7d2 Fix memory leaks when returning refcounted value from curl callback
Closes GH-18883.
2025-06-21 00:31:37 +02:00
Niels Dossche
a84cc91682 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix memory leak when curl_slist_append() fails
2025-05-31 11:14:19 +02:00
Niels Dossche
b2d107db4f Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix memory leak when curl_slist_append() fails
2025-05-31 11:14:13 +02:00
Niels Dossche
d9d991928f Fix memory leak when curl_slist_append() fails
If curl_slist_append() returns NULL, then the original pointer is lost
and not freed.

Closes GH-18711.
2025-05-31 11:11:54 +02:00
David Carlier
07959fc007 Merge branch 'PHP-8.4' 2025-05-02 21:33:02 +01:00
David Carlier
351face053 Merge branch 'PHP-8.3' into PHP-8.4 2025-05-02 21:32:20 +01:00
David Carlier
24ab0f1ea1 Fixed GH-18458: Authorization set with CURLOPT_USERPWD with NULL value.
Close GH-18460
2025-05-02 21:31:50 +01:00
David Carlier
d9d58c9d79 Revert "Fixed GH-18458: Authorization set with CURLOPT_USERPWD with NULL value."
This reverts commit bb431f124c.
2025-04-29 22:48:16 +01:00
David Carlier
bb431f124c Fixed GH-18458: Authorization set with CURLOPT_USERPWD with NULL value. 2025-04-29 22:41:32 +01:00
David Carlier
ad65698a48 ext/curl: CURLOPT_FOLLOWLOCATION option handling.
it had been considered as boolean for years but since 8.13, it can
accept values beyond 1L, respectively CURLFOLLOW_OBEYCODE and
CURLFOLLOW_FIRSTONLY.

close GH-18444
2025-04-29 21:53:38 +01:00
David CARLIER
b233c55b12 ext/curl: curl_getinfo, curl_multi_get_handles and curl_multi_setopt array optimisations. (#18389)
mainly change to packed arrays.
2025-04-21 17:13:57 +01:00
Oskar Stark
195467f014 [ext-curl] Add \CURLOPT_INFILESIZE_LARGE
This is my first PR on this repository and is based on:
* https://github.com/symfony/symfony/pull/59654/files#r1935358570

So feel free to close it :-)
2025-04-09 14:12:14 +07:00
Niels Dossche
c10afa9643 Simplify curl gc handlers (#18227)
Since these objects are final and have no dynamic properties, we don't
have to build a property table.
2025-04-02 17:33:02 +02:00
Gina Peter Banyard
d8e7f362dd ext/curl: Various minor clean-up refactorings (#18042) 2025-03-15 18:14:33 +00:00
Ayesh Karunaratne
6a319928c4 ext/curl: Add CURLINFO_{USED_PROXY,HTTPAUTH_USED,PROXYAUTH_USED}
Adds support for `curl_getinfo()` info keys and additional array keys:

 - [`CURLINFO_USED_PROXY`](https://curl.se/libcurl/c/CURLINFO_USED_PROXY.html) - `libcurl` >= 8.7.9 -
   Zero if no proxy was used in the previous transfer or a non-zero value if a proxy was used.
 - [`CURLINFO_HTTPAUTH_USED`](https://github.com/curl/curl/blob/curl-8_12_0/docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md) - `libcurl` >= 8.7.9 -
   Bitmask indicating the authentication method that was used in the previous HTTP request.
 - [`CURLINFO_PROXYAUTH_USED`](https://github.com/curl/curl/blob/curl-8_12_0/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md) - `libcurl` >= 8.12.0 -
   Bitmask indicating the authentication method that was used in the previous request done over an HTTP proxy.

```php
curl_getinfo($ch);
```
```php
[
	// ...
	"used_proxy" => 0,
	"httpauth_used" => 0,
	"proxyauth_used" => 0,
]
```

This also updates the `Caddyfile` for curl tests to add a new route
that supports HTTP basic auth.
2025-02-17 17:37:27 +07:00
Eric Norris
d20880ce3b RFC: Add CurlSharePersistentHandle objects (#16937)
see https://wiki.php.net/rfc/curl_share_persistence_improvement
2025-01-06 21:52:00 +01:00
Niels Dossche
4591f0427f Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix various memory leaks in curl mime handling
2024-11-26 20:40:16 +01:00
Niels Dossche
8206de62f7 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix various memory leaks in curl mime handling
2024-11-26 20:40:09 +01:00