Skip to content

Commit d2a9edf

Browse files
committed
Callable curl options should be nullable
symfony/http-client/Response/CurlResponse.php depends on this behavior. Closes GH-14165
1 parent 90c5b2a commit d2a9edf

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

ext/curl/interface.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,6 +1520,10 @@ static bool php_curl_set_callable_handler(zend_fcall_info_cache *const handler_f
15201520
zend_fcc_dtor(handler_fcc);
15211521
}
15221522

1523+
if (Z_TYPE_P(callable) == IS_NULL) {
1524+
return true;
1525+
}
1526+
15231527
char *error = NULL;
15241528
if (UNEXPECTED(!zend_is_callable_ex(callable, /* object */ NULL, /* check_flags */ 0, /* callable_name */ NULL, handler_fcc, /* error */ &error))) {
15251529
if (!EG(exception)) {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Callable options are nullable
3+
--EXTENSIONS--
4+
curl
5+
--FILE--
6+
<?php
7+
8+
$ch = curl_init();
9+
curl_setopt_array($ch, [
10+
CURLOPT_PROGRESSFUNCTION => null,
11+
]);
12+
13+
?>
14+
===DONE===
15+
--EXPECT--
16+
===DONE===

0 commit comments

Comments
 (0)