Commit graph

1296 commits

Author SHA1 Message Date
nielsdos
a8a3b99e00 Fix GH-11433: Unable to set CURLOPT_ACCEPT_ENCODING to NULL
Closes GH-11446.
2023-06-13 17:30:57 +02:00
Ilija Tovilo
af6b413691
[skip ci] Add all conflict to curl 2023-04-19 16:23:52 +02:00
Ilija Tovilo
4b22c3e3ad
[skip ci] Skip bug45161.phpt on Windows
See GH-10753

The test is insanely slow on Windows and it's unclear why. It might be a curl
issue.
2023-04-13 13:19:52 +02:00
Niels Dossche
8e620b4ecb Fix GH-10928: PHP Build Failed - Test curl_version() basic functionality [ext/curl/tests/curl_version_basic_001.phpt]
It's possible that curl was compiled without SSL, and/or without libz
support. In the case of the issue reporter it was without libz support.
This causes the test to fail because we expect a non-empty string.
Fix it by using %S instead of %s to allow empty strings.

Closes GH-10930.
2023-03-25 18:15:20 +01:00
Max Kellermann
2646d76abc
ext/curl: suppress -Wdeprecated-declarations in curl_arginfo.h
Disable the warning before including curl_arginfo.h.

(Follow-up for https://github.com/php/php-src/pull/10531)
2023-03-22 20:57:41 +01:00
Ilija Tovilo
0842b13e5c
[skip ci] Add CONFLICTS file for curl tests 2023-03-21 19:17:06 +01:00
Pierrick Charron
91db3a1b85
Fixed bug GH-10270 Unable to return CURL_READFUNC_PAUSE in readfunc callback
Closes GH-10607

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-02-24 14:32:23 +00:00
Max Kellermann
ed4dc39e7f
ext/curl/interface: fix zend_result return value
Closes GH-10640

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-02-21 13:41:07 +00:00
Max Kellermann
8c8a38a75c ext/curl: suppress -Wdeprecated-declarations
Closes GH-10531.
2023-02-08 18:32:13 +00:00
Pierrick Charron
bb010adf29
Merge branch 'PHP-8.0' into PHP-8.1 2022-06-17 19:52:44 -04:00
Pierrick Charron
d84b972658
Fixed CURLOPT_TLSAUTH_TYPE is not treated as a string option. 2022-06-17 19:51:58 -04:00
Christoph M. Becker
59272266ee
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix test for curl 7.83.0
2022-05-03 15:08:43 +02:00
Christoph M. Becker
722e9b9fa5
Fix test for curl 7.83.0
libcurl 7.83.0 removed some trailing exclamation marks from error
messages[1]; we have to cater to that.

[1] <6968fb9d54>

(cherry picked from commit a4179e4c92)
2022-05-03 15:07:50 +02:00
Christoph M. Becker
710dc03399
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Mark curl tests using http2.golang.org as XFAIL
2021-12-26 22:29:17 +01:00
Christoph M. Becker
5005445994
Mark curl tests using http2.golang.org as XFAIL
http2.golang.org/serverpush has been retired[1], so we need to come up
with an alternative.  Until then, we mark the relevant tests as XFAIL
(although bug77535.phpt passes, what might be an indication that the
test needs further revision).  To avoid waiting for the timeout, we
also unconditionally skip these tests for now.

[1] <https://github.com/golang/go/issues/49301>

Closes GH-7829.
2021-12-26 22:27:15 +01:00
Christoph M. Becker
d37c496735
[ci skip] Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] Update the min curl version in the sync-constants.php script
2021-12-23 13:44:23 +01:00
Christophe Coevoet
096a01c905
[ci skip] Update the min curl version in the sync-constants.php script
PHP 8.0 bumped the min curl version to 7.29.0

Closes GH-7805.
2021-12-23 13:43:32 +01:00
Nikita Popov
5adfcfe746 Merge branch 'PHP-8.0'
* PHP-8.0:
  Avoid dangling pointer in curl header.str
2021-08-31 17:25:38 +02:00
Nikita Popov
db055fdb89 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Avoid dangling pointer in curl header.str
2021-08-31 17:24:30 +02:00
Alexey Zamorov
8c292a2f9d Avoid dangling pointer in curl header.str
If buf_len is zero, this would leave behind a dangling pointer
to an already released header.str. Make sure this can't happen
by always overwriting the pointer.

Closes GH-7376.
2021-08-31 17:23:58 +02:00
Nikita Popov
4ba7e5b24d Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix curl_copy_handle() with CURLINFO_HEADER_OUT
2021-08-31 17:09:34 +02:00
Nikita Popov
416dd524f9 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix curl_copy_handle() with CURLINFO_HEADER_OUT
2021-08-31 17:09:07 +02:00
Nikita Popov
30e791ed56 Fix curl_copy_handle() with CURLINFO_HEADER_OUT
The CURLOPT_DEBUGDATA will point to the old curl handle after
copying. Update it to point to the new handle.

We don't separately store whether CURLINFO_HEADER_OUT is enabled,
so I'm doing this unconditionally. It should be harmless if
CURLOPT_DEBUGFUNCTION is not used.
2021-08-31 17:06:41 +02:00
Nikita Popov
992b5f2e08 Make it easier to run curl tests standalone
Fall back to PHP_BINARY if TEST_PHP_EXECUTABLE not given.
2021-08-31 16:53:43 +02:00
Máté Kocsis
17ccabc6b6
Generate optimizer func info from stubs for ext/curl, ext/mysqli, ext/pcre (#7407) 2021-08-26 17:11:45 +02:00
Nikita Popov
6d505d4445 Add RETURN/RETVAL_COPY_DEREF() macros
These were missing from the set...

I think quite a few of these usages don't actually need the DEREF,
but I've just kept things as is for now.
2021-07-22 09:44:19 +02:00
Máté Kocsis
2378f35787
Use single line phpdoc in stubs where possible 2021-07-20 13:16:56 +02:00
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Nikita Popov
977c3d163f Fix file name clash in curl_copy_handle tests 2021-07-20 09:46:18 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Cameron Porter
b11785c5e4 Fixed bug #81085: Add version 7.71.0 blob options.
Adds support for the following options beginning with version 7.71.0:

    CURLOPT_ISSUERCERT_BLOB
    CURLOPT_PROXY_ISSUERCERT
    CURLOPT_PROXY_ISSUERCERT_BLOB
    CURLOPT_PROXY_SSLCERT_BLOB
    CURLOPT_PROXY_SSLKEY_BLOB
    CURLOPT_SSLCERT_BLOB
    CURLOPT_SSLKEY_BLOB

Closes GH-7194.
2021-06-28 09:54:45 +02:00
Nikita Popov
ca423a1b39 Remove unnecessary curl skipifs
These test for functions/versions that are always available.
2021-06-14 15:34:24 +02:00
Nikita Popov
06053e9b67 Remove unnecessary curl version guards in stubs
We have bumped the libcurl requirement to 7.29.0 in PHP 8.1,
but the function declarations in the stubs were still conditional
on the curl version. Drop them to make it more obvious that these
functions are always available.
2021-06-14 15:33:26 +02:00
Nikita Popov
6600ad6067 Add some missing EXTENSIONS sections to misc tests 2021-06-14 14:52:44 +02:00
Nikita Popov
8567bc10c4
Port curl, xml, xsql to use EXTENSIONS (#7140) 2021-06-11 13:57:47 +02:00
Nikita Popov
39131219e8
Migrate more SKIPIF -> EXTENSIONS (#7139)
This is a mix of more automated and manual migration. It should remove all applicable extension_loaded() checks outside of skipif.inc files.
2021-06-11 12:58:44 +02:00
Nikita Popov
e989492f1a Drop handling for PHP_CURL_HTTP_REMOVE_SERVER
Historically it was necessary to use a separate server to test
curl against. For many years now we use the builtin server instead.
I don't believe there's much point in retaining this functionality.
2021-06-11 12:55:03 +02:00
Nikita Popov
7485978339
Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00
Nikita Popov
ea256a218b Add %0 format to run-tests.php
This format matches against null bytes, and prevents the test
expectation from being interpreted as binary data.

bless_tests.php will automatically replace \0 with %0 as well.
2021-05-29 11:33:13 +02:00
Máté Kocsis
737af24644
Declare tentative return types for ext/curl
Relates to GH-6985
2021-05-26 12:30:07 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Máté Kocsis
750b04a6e1 Use typed properties in ext/curl 2021-04-20 14:45:42 +02:00
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
Nikita Popov
ce0bc58c22 Merge branch 'PHP-8.0'
* PHP-8.0:
  Mark resource-like objects as non-comparable
2021-02-16 14:22:03 +01:00
Nikita Popov
b63ea1047a Mark resource-like objects as non-comparable
As these hold on to some internal resource, there can't be two
"equal" objects with different identity. Make sure the lack of
public properties doesn't result in these being treated as always
equal.
2021-02-16 14:20:45 +01:00
Máté Kocsis
bf0f6aaf18
Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Alexander Moskalev
e727919b97 cURL: make possible to send file from buffer string
Add CURLStringFile class which works similarly to CURLFile, but
uploads a file from a string rather than a file. This avoids the
need to create a temporary file, or use of a data:// stream.

Basic usage:

    $file = new CURLStringFile($data, 'filename.txt', 'text/plain');
    curl_setopt($curl, CURLOPT_POSTFIELDS, ['file' => $file]);

Closes GH-6456.
2021-02-16 10:24:22 +01:00
Christoph M. Becker
0cdc634fc4 Merge branch 'PHP-8.0'
* PHP-8.0:
  Adapt test case for libcurl 7.75.0+
2021-02-16 00:30:03 +01:00
Christoph M. Becker
afe17cc1b6 Adapt test case for libcurl 7.75.0+
libcurl 7.75.0 finally adds support for `gophers://`, i.e. gopher over
TLS.  The protocol is neither standardized, nor is the protocol
registered with IANA, but well, it is there and the test case should
cater to that.
2021-02-16 00:28:34 +01:00
Máté Kocsis
99b08ac281
Implicitly enable function entry generation when class entry generation is enabled
Closes GH-6675
2021-02-09 13:37:24 +01:00