mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Callable curl options should be nullable
symfony/http-client/Response/CurlResponse.php depends on this behavior. Closes GH-14165
This commit is contained in:
parent
90c5b2a43b
commit
d2a9edfee6
@ -1520,6 +1520,10 @@ static bool php_curl_set_callable_handler(zend_fcall_info_cache *const handler_f
|
||||
zend_fcc_dtor(handler_fcc);
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(callable) == IS_NULL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
char *error = NULL;
|
||||
if (UNEXPECTED(!zend_is_callable_ex(callable, /* object */ NULL, /* check_flags */ 0, /* callable_name */ NULL, handler_fcc, /* error */ &error))) {
|
||||
if (!EG(exception)) {
|
||||
|
16
ext/curl/tests/callable_nullable_option.phpt
Normal file
16
ext/curl/tests/callable_nullable_option.phpt
Normal file
@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Callable options are nullable
|
||||
--EXTENSIONS--
|
||||
curl
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_PROGRESSFUNCTION => null,
|
||||
]);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
Loading…
Reference in New Issue
Block a user