Skip to content

Commit 8aea481

Browse files
authored
Fix argument number in curl_multi_setopt() CURLMOPT_PUSHFUNCTION error (#25367)
1 parent b6df294 commit 8aea481

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎ext/curl/multi.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ static bool _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue
460460
char *error_str = NULL;
461461
if (UNEXPECTED(!zend_is_callable_ex(zvalue, /* object */ NULL, /* check_flags */ 0, /* callable_name */ NULL, &mh->handlers.server_push, /* error */ &error_str))) {
462462
if (!EG(exception)) {
463-
zend_argument_type_error(2, "must be a valid callback for option CURLMOPT_PUSHFUNCTION, %s", error_str);
463+
zend_argument_type_error(3, "must be a valid callback for option CURLMOPT_PUSHFUNCTION, %s", error_str);
464464
}
465465
efree(error_str);
466466
return false;

‎ext/curl/tests/curl_multi_setopt_callables.phpt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ try {
1414

1515
?>
1616
--EXPECT--
17-
TypeError: curl_multi_setopt(): Argument #2 ($option) must be a valid callback for option CURLMOPT_PUSHFUNCTION, function "undefined" not found or invalid function name
17+
TypeError: curl_multi_setopt(): Argument #3 ($value) must be a valid callback for option CURLMOPT_PUSHFUNCTION, function "undefined" not found or invalid function name

0 commit comments

Comments
 (0)