From da18edb2f4f9e28d1c7a088c67c15f03310585c9 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 1 Nov 2026 16:06:15 +0000 Subject: [PATCH 1/5] curl: add test for option type checking --- .../curl_setopt_option_value_errors.phpt | 686 ++++++++++++++++++ 1 file changed, 686 insertions(+) create mode 100644 ext/curl/tests/curl_setopt_option_value_errors.phpt diff --git a/ext/curl/tests/curl_setopt_option_value_errors.phpt b/ext/curl/tests/curl_setopt_option_value_errors.phpt new file mode 100644 index 000000000000..34d80534052a --- /dev/null +++ b/ext/curl/tests/curl_setopt_option_value_errors.phpt @@ -0,0 +1,686 @@ +--TEST-- +Check that curl_setopt() values are of the correct type for the given option +--EXTENSIONS-- +curl +--FILE-- +getConstants(); + +foreach ($constants as $name => $constant) { + try { + $r = curl_setopt($ch, $constant, $obj); + if ($r === false) { + echo "Option $name failed\n"; + } else { + echo "Option $name succeeded\n"; + } + } catch (Throwable $e) { + if (!isKnownError($e->getMessage())) { + echo "Option $name failed with exception:\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; + } + } +} + +?> +--EXPECTF-- +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_AUTOREFERER succeeded +Option CURLOPT_BINARYTRANSFER succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_BUFFERSIZE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_CONNECTTIMEOUT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_COOKIESESSION succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_CRLF succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_DNS_CACHE_TIMEOUT succeeded +Option CURLOPT_DNS_USE_GLOBAL_CACHE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FAILONERROR succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FILETIME succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FOLLOWLOCATION succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FORBID_REUSE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FRESH_CONNECT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FTPAPPEND succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FTPLISTONLY succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FTP_USE_EPRT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FTP_USE_EPSV succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_HEADER succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_HTTPGET succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_HTTPPROXYTUNNEL succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_HTTP_VERSION succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_INFILESIZE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_INFILESIZE_LARGE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_LOW_SPEED_LIMIT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_LOW_SPEED_TIME succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_MAXCONNECTS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_MAXREDIRS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_NETRC succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_NOBODY succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_NOPROGRESS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_NOSIGNAL succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PORT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_POST succeeded +Option CURLOPT_PRIVATE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PROXYPORT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PROXYTYPE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PUT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_RESUME_FROM succeeded +Option CURLOPT_RETURNTRANSFER succeeded +Option CURLOPT_SHARE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SSLVERSION succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d + +Notice: curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead in %s on line %d +Option CURLOPT_SSL_VERIFYHOST succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SSL_VERIFYPEER succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TCP_KEEPCNT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TIMECONDITION succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TIMEOUT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TIMEVALUE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TRANSFERTEXT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_UNRESTRICTED_AUTH succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_UPLOAD succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_VERBOSE succeeded +Option CURLFOLLOW_OBEYCODE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLFOLLOW_FIRSTONLY succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLINFO_DATA_IN succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_ABORTED_BY_CALLBACK succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_BAD_CALLING_ORDER succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_BAD_CONTENT_ENCODING succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_BAD_FUNCTION_ARGUMENT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_BAD_PASSWORD_ENTERED succeeded +Option CURLE_FAILED_INIT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_FTP_COULDNT_GET_SIZE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_FTP_COULDNT_RETR_FILE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_FTP_QUOTE_ERROR succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_FTP_WEIRD_227_FORMAT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_FTP_WEIRD_PASV_REPLY succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_FTP_WRITE_ERROR succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_FUNCTION_NOT_FOUND succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_GOT_NOTHING succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_HTTP_PORT_FAILED succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_HTTP_POST_ERROR succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_HTTP_RANGE_ERROR succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_OBSOLETE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_OUT_OF_MEMORY succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_SSL_CERTPROBLEM succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_SSL_CIPHER succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_SSL_ENGINE_NOTFOUND succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_SSL_ENGINE_SETFAILED succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_TOO_MANY_REDIRECTS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_UNKNOWN_TELNET_OPTION succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_URL_MALFORMAT succeeded +Option CURLINFO_HEADER_OUT succeeded +Option CURLM_BAD_EASY_HANDLE succeeded +Option CURLM_CALL_MULTI_PERFORM succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLM_OUT_OF_MEMORY succeeded +Option CURLSHOPT_UNSHARE succeeded +Option CURL_HTTP_VERSION_1_1 succeeded +Option CURL_LOCK_DATA_COOKIE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURL_LOCK_DATA_DNS succeeded +Option CURL_NETRC_REQUIRED succeeded +Option CURL_SSLVERSION_SSLv2 succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURL_SSLVERSION_SSLv3 succeeded +Option CURL_TIMECOND_IFUNMODSINCE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURL_TIMECOND_LASTMOD succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURL_VERSION_DEBUG succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURL_VERSION_GSSNEGOTIATE succeeded +Option CURL_VERSION_KERBEROS4 succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_HTTPAUTH succeeded +Option CURLAUTH_DIGEST succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FTP_CREATE_MISSING_DIRS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PROXYAUTH succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FTP_RESPONSE_TIMEOUT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SERVER_RESPONSE_TIMEOUT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_IPRESOLVE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_MAXFILESIZE succeeded +Option CURL_IPRESOLVE_V6 succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLE_FTP_SSL_FAILED succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLFTPSSL_ALL succeeded +Option CURLFTPSSL_CONTROL succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FTP_SSL succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_MAXFILESIZE_LARGE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TCP_NODELAY succeeded +Option CURLFTPAUTH_TLS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FTPSSLAUTH succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_IGNORE_CONTENT_LENGTH succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FTP_SKIP_PASV_IP succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FTP_FILEMETHOD succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_CONNECT_ONLY succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_LOCALPORT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_LOCALPORTRANGE succeeded +Option CURLFTPMETHOD_NOCWD succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLFTPMETHOD_SINGLECWD succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_MAX_RECV_SPEED_LARGE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_MAX_SEND_SPEED_LARGE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SSL_SESSIONID_CACHE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLMOPT_PIPELINING succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FTP_SSL_CCC succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SSH_AUTH_TYPES succeeded +Option CURLFTPSSL_CCC_ACTIVE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_CONNECTTIMEOUT_MS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_HTTP_CONTENT_DECODING succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_HTTP_TRANSFER_DECODING succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TIMEOUT_MS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_NEW_DIRECTORY_PERMS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_NEW_FILE_PERMS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_APPEND succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_DIRLISTONLY succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_USE_SSL succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLUSESSL_ALL succeeded +Option CURLUSESSL_CONTROL succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PROXY_TRANSFER_MODE succeeded +Option CURL_SEEKFUNC_CANTSEEK succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_ADDRESS_SCOPE succeeded +Option CURLSSH_AUTH_ANY succeeded +Option CURLSSH_AUTH_DEFAULT succeeded +Option CURLSSH_AUTH_PASSWORD succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_CERTINFO succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_POSTREDIR succeeded +Option CURL_REDIR_POST_302 succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PROTOCOLS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_REDIR_PROTOCOLS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SOCKS5_GSSAPI_NEC succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TFTP_BLKSIZE succeeded +Option CURLPROTO_ALL succeeded +Option CURLPROTO_HTTPS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLPROTO_SFTP succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLPROTO_TELNET succeeded +Option CURLFTP_CREATE_DIR_RETRY succeeded +Option CURLKHMATCH_MISSING succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLKHMATCH_LAST succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_FTP_USE_PRET succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_RTSP_CLIENT_CSEQ succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_RTSP_REQUEST succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_RTSP_SERVER_CSEQ succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURL_RTSPREQ_ANNOUNCE succeeded +Option CURL_RTSPREQ_DESCRIBE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_WILDCARDMATCH succeeded +Option CURL_FNMATCHFUNC_FAIL succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLAUTH_NTLM_WB succeeded +Option CURLGSSAPI_DELEGATION_FLAG succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_GSSAPI_DELEGATION succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_ACCEPTTIMEOUT_MS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SSL_OPTIONS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TCP_KEEPALIVE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TCP_KEEPIDLE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TCP_KEEPINTVL succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLMOPT_MAX_TOTAL_CONNECTIONS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SASL_IR succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURL_HTTP_VERSION_2_0 succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_EXPECT_100_TIMEOUT_MS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SSL_ENABLE_ALPN succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SSL_ENABLE_NPN succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_HEADEROPT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SSL_VERIFYSTATUS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PATH_AS_IS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SSL_FALSESTART failed + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURL_HTTP_VERSION_2 succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PIPEWAIT succeeded +Option CURLPIPE_MULTIPLEX succeeded +Option CURLSSLOPT_NO_REVOKE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_STREAM_WEIGHT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TFTP_NO_OPTIONS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TCP_FASTOPEN succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_KEEP_SENDING_ON_ERROR succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PROXY_SSL_OPTIONS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PROXY_SSL_VERIFYHOST succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PROXY_SSL_VERIFYPEER succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_PROXY_SSLVERSION succeeded +Option CURLPROXY_HTTPS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SUPPRESS_CONNECT_HEADERS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SOCKS5_AUTH succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_SSH_COMPRESSION succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLSSH_AUTH_GSSAPI succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_TIMEVALUE_LARGE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_DNS_SHUFFLE_ADDRESSES succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_HAPROXYPROTOCOL succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLAUTH_BEARER succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_DISALLOW_USERNAME_IN_URL succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_UPKEEP_INTERVAL_MS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_UPLOAD_BUFFERSIZE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_HTTP09_ALLOWED succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLALTSVC_H3 succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_ALTSVC_CTRL succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_MAXAGE_CONN succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_MAIL_RCPT_ALLLOWFAILS succeeded +Option CURLPX_BAD_VERSION succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLPX_CLOSED succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLPX_RECV_ADDRESS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLPX_RECV_AUTH succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLPX_REPLY_CONNECTION_REFUSED succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLPX_REPLY_GENERAL_SERVER_FAILURE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLPX_REPLY_HOST_UNREACHABLE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLPX_RESOLVE_HOST succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLPX_UNKNOWN_MODE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLPX_USER_REJECTED succeeded +Option CURLHSTS_READONLYFILE succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_HSTS_CTRL succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_DOH_SSL_VERIFYHOST succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_DOH_SSL_VERIFYPEER succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_DOH_SSL_VERIFYSTATUS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLSSLOPT_AUTO_CLIENT_CERT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_MAXLIFETIME_CONN succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_MIME_OPTIONS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_WS_OPTIONS succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_CA_CACHE_TIMEOUT succeeded + +Warning: Object of class stdClass could not be converted to int in %s on line %d +Option CURLOPT_QUICK_EXIT succeeded +Option CURLOPT_SAFE_UPLOAD succeeded From 70529e6e8f8853a88a3a629c621323de20d96005 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 1 Nov 2026 16:41:50 +0000 Subject: [PATCH 2/5] curl: check option value is of type int --- ext/curl/interface.c | 78 ++- .../curl_read_function_error_on_int.phpt | 2 +- .../curl_setopt_option_value_errors.phpt | 592 +----------------- 3 files changed, 67 insertions(+), 605 deletions(-) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 2db6efa605ae..f5000eea3e7f 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1713,7 +1713,6 @@ static bool php_curl_set_callable_handler(zend_fcall_info_cache *const handler_f static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue, bool is_array_config) /* {{{ */ { CURLcode error = CURLE_OK; - zend_long lval; switch (option) { /* Callable options */ @@ -1735,14 +1734,39 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue #endif /* Long options */ - case CURLOPT_SSL_VERIFYHOST: - lval = zval_get_long(zvalue); + case CURLOPT_PROTOCOLS: + case CURLOPT_REDIR_PROTOCOLS: { + bool failed = false; + zend_long lval = zval_try_get_long(zvalue, &failed); + if (UNEXPECTED(failed)) { + zend_argument_type_error(2 + !is_array_config, + "must be of type int for option CURLOPT_%s, %s given", + php_curl_option_get_name(option), zend_zval_type_name(zvalue)); + return FAILURE; + } + if (PG(open_basedir) && *PG(open_basedir) && (lval & CURLPROTO_FILE)) { + php_error_docref(NULL, E_WARNING, "CURLPROTO_FILE cannot be activated when an open_basedir is set"); + return FAILURE; + } + error = curl_easy_setopt(ch->cp, option, lval); + break; + } + case CURLOPT_SSL_VERIFYHOST: { + bool failed = false; + zend_long lval = zval_try_get_long(zvalue, &failed); + if (UNEXPECTED(failed)) { + zend_argument_type_error(2 + !is_array_config, + "must be of type int for option CURLOPT_%s, %s given", + php_curl_option_get_name(option), zend_zval_type_name(zvalue)); + return FAILURE; + } if (lval == 1) { php_error_docref(NULL, E_NOTICE, "CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead"); - error = curl_easy_setopt(ch->cp, option, 2L); - break; + lval = 2L; } - ZEND_FALLTHROUGH; + error = curl_easy_setopt(ch->cp, option, lval); + break; + } case CURLOPT_AUTOREFERER: case CURLOPT_BUFFERSIZE: case CURLOPT_CONNECTTIMEOUT: @@ -1812,8 +1836,6 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue case CURLOPT_PROXY_TRANSFER_MODE: case CURLOPT_ADDRESS_SCOPE: case CURLOPT_CERTINFO: - case CURLOPT_PROTOCOLS: - case CURLOPT_REDIR_PROTOCOLS: case CURLOPT_SOCKS5_GSSAPI_NEC: case CURLOPT_TFTP_BLKSIZE: case CURLOPT_FTP_USE_PRET: @@ -1891,15 +1913,18 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue #if LIBCURL_VERSION_NUM >= 0x080900 /* Available since 8.9.0 */ case CURLOPT_TCP_KEEPCNT: #endif - case CURLOPT_FOLLOWLOCATION: - lval = zval_get_long(zvalue); - if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) && - (PG(open_basedir) && *PG(open_basedir)) && (lval & CURLPROTO_FILE)) { - php_error_docref(NULL, E_WARNING, "CURLPROTO_FILE cannot be activated when an open_basedir is set"); - return FAILURE; + case CURLOPT_FOLLOWLOCATION: { + bool failed = false; + zend_long lval = zval_try_get_long(zvalue, &failed); + if (UNEXPECTED(failed)) { + zend_argument_type_error(2 + !is_array_config, + "must be of type int for option CURLOPT_%s, %s given", + php_curl_option_get_name(option), zend_zval_type_name(zvalue)); + return FAILURE; } error = curl_easy_setopt(ch->cp, option, lval); break; + } case CURLOPT_SAFE_UPLOAD: if (!zend_is_true(zvalue)) { zend_value_error("%s(): Disabling safe uploads is no longer supported", get_active_function_name()); @@ -2254,15 +2279,32 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue case CURLOPT_MAX_RECV_SPEED_LARGE: case CURLOPT_MAX_SEND_SPEED_LARGE: case CURLOPT_MAXFILESIZE_LARGE: - case CURLOPT_TIMEVALUE_LARGE: - lval = zval_get_long(zvalue); + case CURLOPT_TIMEVALUE_LARGE: { + bool failed = false; + zend_long lval = zval_try_get_long(zvalue, &failed); + if (UNEXPECTED(failed)) { + zend_argument_type_error(2 + !is_array_config, + "must be of type int for option CURLOPT_%s, %s given", + php_curl_option_get_name(option), zend_zval_type_name(zvalue)); + return FAILURE; + } + // TODO bound check that lval fits in curl_off_t? error = curl_easy_setopt(ch->cp, option, (curl_off_t)lval); break; + } - case CURLOPT_POSTREDIR: - lval = zval_get_long(zvalue); + case CURLOPT_POSTREDIR: { + bool failed = false; + zend_long lval = zval_try_get_long(zvalue, &failed); + if (UNEXPECTED(failed)) { + zend_argument_type_error(2 + !is_array_config, + "must be of type int for option CURLOPT_%s, %s given", + php_curl_option_get_name(option), zend_zval_type_name(zvalue)); + return FAILURE; + } error = curl_easy_setopt(ch->cp, CURLOPT_POSTREDIR, (long) (lval & CURL_REDIR_POST_ALL)); break; + } /* the following options deal with files, therefore the open_basedir check * is required. diff --git a/ext/curl/tests/curl_read_function_error_on_int.phpt b/ext/curl/tests/curl_read_function_error_on_int.phpt index 0b4d86e07b43..6ff37d34fc6c 100644 --- a/ext/curl/tests/curl_read_function_error_on_int.phpt +++ b/ext/curl/tests/curl_read_function_error_on_int.phpt @@ -14,7 +14,7 @@ include 'server.inc'; $host = curl_cli_server_start(); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=post"); -curl_setopt($ch, CURLOPT_POST, ['f' => 'f']); +curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 2); curl_setopt($ch, CURLOPT_READFUNCTION, "custom_readfunction" ); diff --git a/ext/curl/tests/curl_setopt_option_value_errors.phpt b/ext/curl/tests/curl_setopt_option_value_errors.phpt index 34d80534052a..a7f50a1ccd9a 100644 --- a/ext/curl/tests/curl_setopt_option_value_errors.phpt +++ b/ext/curl/tests/curl_setopt_option_value_errors.phpt @@ -29,6 +29,12 @@ function isKnownError($error): bool { )) { return true; } + if (preg_match( + '/curl_setopt\(\): Argument #3 \(\$value\) must be of type int for option CURLOPT_([A-Z0-9_])+, stdClass given/', + $error, + )) { + return true; + } return false; } @@ -56,631 +62,45 @@ foreach ($constants as $name => $constant) { ?> --EXPECTF-- -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_AUTOREFERER succeeded Option CURLOPT_BINARYTRANSFER succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_BUFFERSIZE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_CONNECTTIMEOUT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_COOKIESESSION succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_CRLF succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_DNS_CACHE_TIMEOUT succeeded Option CURLOPT_DNS_USE_GLOBAL_CACHE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FAILONERROR succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FILETIME succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FOLLOWLOCATION succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FORBID_REUSE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FRESH_CONNECT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FTPAPPEND succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FTPLISTONLY succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FTP_USE_EPRT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FTP_USE_EPSV succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_HEADER succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_HTTPGET succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_HTTPPROXYTUNNEL succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_HTTP_VERSION succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_INFILESIZE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_INFILESIZE_LARGE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_LOW_SPEED_LIMIT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_LOW_SPEED_TIME succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_MAXCONNECTS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_MAXREDIRS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_NETRC succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_NOBODY succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_NOPROGRESS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_NOSIGNAL succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PORT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_POST succeeded Option CURLOPT_PRIVATE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PROXYPORT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PROXYTYPE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PUT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_RESUME_FROM succeeded Option CURLOPT_RETURNTRANSFER succeeded Option CURLOPT_SHARE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SSLVERSION succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d - -Notice: curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead in %s on line %d -Option CURLOPT_SSL_VERIFYHOST succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SSL_VERIFYPEER succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TCP_KEEPCNT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TIMECONDITION succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TIMEOUT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TIMEVALUE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TRANSFERTEXT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_UNRESTRICTED_AUTH succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_UPLOAD succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_VERBOSE succeeded Option CURLFOLLOW_OBEYCODE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLFOLLOW_FIRSTONLY succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLINFO_DATA_IN succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_ABORTED_BY_CALLBACK succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_BAD_CALLING_ORDER succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_BAD_CONTENT_ENCODING succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_BAD_FUNCTION_ARGUMENT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_BAD_PASSWORD_ENTERED succeeded Option CURLE_FAILED_INIT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_FTP_COULDNT_GET_SIZE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_FTP_COULDNT_RETR_FILE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_FTP_QUOTE_ERROR succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_FTP_WEIRD_227_FORMAT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_FTP_WEIRD_PASV_REPLY succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_FTP_WRITE_ERROR succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_FUNCTION_NOT_FOUND succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_GOT_NOTHING succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_HTTP_PORT_FAILED succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_HTTP_POST_ERROR succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_HTTP_RANGE_ERROR succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_OBSOLETE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_OUT_OF_MEMORY succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_SSL_CERTPROBLEM succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_SSL_CIPHER succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_SSL_ENGINE_NOTFOUND succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_SSL_ENGINE_SETFAILED succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_TOO_MANY_REDIRECTS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_UNKNOWN_TELNET_OPTION succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_URL_MALFORMAT succeeded Option CURLINFO_HEADER_OUT succeeded Option CURLM_BAD_EASY_HANDLE succeeded Option CURLM_CALL_MULTI_PERFORM succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLM_OUT_OF_MEMORY succeeded Option CURLSHOPT_UNSHARE succeeded Option CURL_HTTP_VERSION_1_1 succeeded Option CURL_LOCK_DATA_COOKIE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURL_LOCK_DATA_DNS succeeded Option CURL_NETRC_REQUIRED succeeded Option CURL_SSLVERSION_SSLv2 succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURL_SSLVERSION_SSLv3 succeeded Option CURL_TIMECOND_IFUNMODSINCE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURL_TIMECOND_LASTMOD succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURL_VERSION_DEBUG succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURL_VERSION_GSSNEGOTIATE succeeded Option CURL_VERSION_KERBEROS4 succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_HTTPAUTH succeeded Option CURLAUTH_DIGEST succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FTP_CREATE_MISSING_DIRS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PROXYAUTH succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FTP_RESPONSE_TIMEOUT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SERVER_RESPONSE_TIMEOUT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_IPRESOLVE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_MAXFILESIZE succeeded Option CURL_IPRESOLVE_V6 succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLE_FTP_SSL_FAILED succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLFTPSSL_ALL succeeded Option CURLFTPSSL_CONTROL succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FTP_SSL succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_MAXFILESIZE_LARGE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TCP_NODELAY succeeded Option CURLFTPAUTH_TLS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FTPSSLAUTH succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_IGNORE_CONTENT_LENGTH succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FTP_SKIP_PASV_IP succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FTP_FILEMETHOD succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_CONNECT_ONLY succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_LOCALPORT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_LOCALPORTRANGE succeeded Option CURLFTPMETHOD_NOCWD succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLFTPMETHOD_SINGLECWD succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_MAX_RECV_SPEED_LARGE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_MAX_SEND_SPEED_LARGE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SSL_SESSIONID_CACHE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLMOPT_PIPELINING succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FTP_SSL_CCC succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SSH_AUTH_TYPES succeeded Option CURLFTPSSL_CCC_ACTIVE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_CONNECTTIMEOUT_MS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_HTTP_CONTENT_DECODING succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_HTTP_TRANSFER_DECODING succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TIMEOUT_MS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_NEW_DIRECTORY_PERMS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_NEW_FILE_PERMS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_APPEND succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_DIRLISTONLY succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_USE_SSL succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLUSESSL_ALL succeeded Option CURLUSESSL_CONTROL succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PROXY_TRANSFER_MODE succeeded Option CURL_SEEKFUNC_CANTSEEK succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_ADDRESS_SCOPE succeeded Option CURLSSH_AUTH_ANY succeeded Option CURLSSH_AUTH_DEFAULT succeeded Option CURLSSH_AUTH_PASSWORD succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_CERTINFO succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_POSTREDIR succeeded Option CURL_REDIR_POST_302 succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PROTOCOLS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_REDIR_PROTOCOLS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SOCKS5_GSSAPI_NEC succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TFTP_BLKSIZE succeeded Option CURLPROTO_ALL succeeded Option CURLPROTO_HTTPS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLPROTO_SFTP succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLPROTO_TELNET succeeded Option CURLFTP_CREATE_DIR_RETRY succeeded Option CURLKHMATCH_MISSING succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLKHMATCH_LAST succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_FTP_USE_PRET succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_RTSP_CLIENT_CSEQ succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_RTSP_REQUEST succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_RTSP_SERVER_CSEQ succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURL_RTSPREQ_ANNOUNCE succeeded Option CURL_RTSPREQ_DESCRIBE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_WILDCARDMATCH succeeded Option CURL_FNMATCHFUNC_FAIL succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLAUTH_NTLM_WB succeeded Option CURLGSSAPI_DELEGATION_FLAG succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_GSSAPI_DELEGATION succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_ACCEPTTIMEOUT_MS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SSL_OPTIONS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TCP_KEEPALIVE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TCP_KEEPIDLE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TCP_KEEPINTVL succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLMOPT_MAX_TOTAL_CONNECTIONS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SASL_IR succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURL_HTTP_VERSION_2_0 succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_EXPECT_100_TIMEOUT_MS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SSL_ENABLE_ALPN succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SSL_ENABLE_NPN succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_HEADEROPT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SSL_VERIFYSTATUS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PATH_AS_IS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SSL_FALSESTART failed - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURL_HTTP_VERSION_2 succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PIPEWAIT succeeded Option CURLPIPE_MULTIPLEX succeeded Option CURLSSLOPT_NO_REVOKE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_STREAM_WEIGHT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TFTP_NO_OPTIONS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TCP_FASTOPEN succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_KEEP_SENDING_ON_ERROR succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PROXY_SSL_OPTIONS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PROXY_SSL_VERIFYHOST succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PROXY_SSL_VERIFYPEER succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_PROXY_SSLVERSION succeeded Option CURLPROXY_HTTPS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SUPPRESS_CONNECT_HEADERS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SOCKS5_AUTH succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_SSH_COMPRESSION succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLSSH_AUTH_GSSAPI succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_TIMEVALUE_LARGE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_DNS_SHUFFLE_ADDRESSES succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_HAPROXYPROTOCOL succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLAUTH_BEARER succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_DISALLOW_USERNAME_IN_URL succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_UPKEEP_INTERVAL_MS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_UPLOAD_BUFFERSIZE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_HTTP09_ALLOWED succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLALTSVC_H3 succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_ALTSVC_CTRL succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_MAXAGE_CONN succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_MAIL_RCPT_ALLLOWFAILS succeeded Option CURLPX_BAD_VERSION succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLPX_CLOSED succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLPX_RECV_ADDRESS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLPX_RECV_AUTH succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLPX_REPLY_CONNECTION_REFUSED succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLPX_REPLY_GENERAL_SERVER_FAILURE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLPX_REPLY_HOST_UNREACHABLE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLPX_RESOLVE_HOST succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLPX_UNKNOWN_MODE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLPX_USER_REJECTED succeeded Option CURLHSTS_READONLYFILE succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_HSTS_CTRL succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_DOH_SSL_VERIFYHOST succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_DOH_SSL_VERIFYPEER succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_DOH_SSL_VERIFYSTATUS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLSSLOPT_AUTO_CLIENT_CERT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_MAXLIFETIME_CONN succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_MIME_OPTIONS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_WS_OPTIONS succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_CA_CACHE_TIMEOUT succeeded - -Warning: Object of class stdClass could not be converted to int in %s on line %d -Option CURLOPT_QUICK_EXIT succeeded Option CURLOPT_SAFE_UPLOAD succeeded From 23e5f927220c7a05290e809aa84e2a0ce176e64e Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 1 Nov 2026 16:45:31 +0000 Subject: [PATCH 3/5] curl: verify value for CURLOPT_SHARE is a CurlShareHandler --- ext/curl/interface.c | 12 ++++++------ ext/curl/tests/curl_setopt_option_value_errors.phpt | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index f5000eea3e7f..6ac19b9d6f6a 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -2353,12 +2353,12 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue case CURLOPT_SHARE: { - if (Z_TYPE_P(zvalue) != IS_OBJECT) { - break; - } - - if (Z_OBJCE_P(zvalue) != curl_share_ce && Z_OBJCE_P(zvalue) != curl_share_persistent_ce) { - break; + if (Z_TYPE_P(zvalue) != IS_OBJECT || (Z_OBJCE_P(zvalue) != curl_share_ce && Z_OBJCE_P(zvalue) != curl_share_persistent_ce)) { + zend_argument_type_error(2 + !is_array_config, + "must be of type CurlSharePersistentHandle|CurlShareHandle for option CURLOPT_SHARE, %s given", + zend_zval_type_name(zvalue) + ); + return FAILURE; } php_curlsh *sh = Z_CURL_SHARE_P(zvalue); diff --git a/ext/curl/tests/curl_setopt_option_value_errors.phpt b/ext/curl/tests/curl_setopt_option_value_errors.phpt index a7f50a1ccd9a..7e88444e2a7d 100644 --- a/ext/curl/tests/curl_setopt_option_value_errors.phpt +++ b/ext/curl/tests/curl_setopt_option_value_errors.phpt @@ -10,6 +10,7 @@ const KNOWNS_ERRORS = [ 'curl_setopt(): supplied argument is not a valid File-Handle resource', 'Object of class stdClass could not be converted to string', 'curl_setopt(): The CURLOPT_HTTP200ALIASES option must have an array value', + 'curl_setopt(): Argument #3 ($value) must be of type CurlSharePersistentHandle|CurlShareHandle for option CURLOPT_SHARE, stdClass given', ]; function isKnownError($error): bool { @@ -66,7 +67,6 @@ Option CURLOPT_BINARYTRANSFER succeeded Option CURLOPT_DNS_USE_GLOBAL_CACHE succeeded Option CURLOPT_PRIVATE succeeded Option CURLOPT_RETURNTRANSFER succeeded -Option CURLOPT_SHARE succeeded Option CURLFOLLOW_OBEYCODE succeeded Option CURLE_FAILED_INIT succeeded Option CURLINFO_HEADER_OUT succeeded From 282ea91e8385e0988f08533094466ce373477b0d Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 1 Nov 2026 17:06:48 +0000 Subject: [PATCH 4/5] curl: check option value is of type string --- ext/curl/interface.c | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 6ac19b9d6f6a..6308c10b1e26 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -2012,7 +2012,13 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue #endif { zend_string *tmp_str; - zend_string *str = zval_get_tmp_string(zvalue, &tmp_str); + zend_string *str = zval_try_get_tmp_string(zvalue, &tmp_str); + if (UNEXPECTED(str == NULL)) { + zend_argument_type_error(2 + !is_array_config, + "must be of type string for option CURLOPT_%s, %s given", + php_curl_option_get_name(option), zend_zval_type_name(zvalue)); + return FAILURE; + } #if LIBCURL_VERSION_NUM >= 0x075500 /* Available since 7.85.0 */ if ((option == CURLOPT_PROTOCOLS_STR || option == CURLOPT_REDIR_PROTOCOLS_STR) && (PG(open_basedir) && *PG(open_basedir)) @@ -2061,7 +2067,13 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue error = curl_easy_setopt(ch->cp, option, NULL); } else { zend_string *tmp_str; - zend_string *str = zval_get_tmp_string(zvalue, &tmp_str); + zend_string *str = zval_try_get_tmp_string(zvalue, &tmp_str); + if (UNEXPECTED(str == NULL)) { + zend_argument_type_error(2 + !is_array_config, + "must be of type string for option CURLOPT_%s, %s given", + php_curl_option_get_name(option), zend_zval_type_name(zvalue)); + return FAILURE; + } zend_result ret = php_curl_option_str(ch, option, ZSTR_VAL(str), ZSTR_LEN(str)); zend_tmp_string_release(tmp_str); return ret; @@ -2081,7 +2093,11 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue case CURLOPT_URL: { zend_string *tmp_str; - zend_string *str = zval_get_tmp_string(zvalue, &tmp_str); + zend_string *str = zval_try_get_tmp_string(zvalue, &tmp_str); + if (UNEXPECTED(str == NULL)) { + zend_argument_type_error(2 + !is_array_config, "must be of type string for option CURLOPT_URl, %s given", zend_zval_type_name(zvalue)); + return FAILURE; + } zend_result ret = php_curl_option_url(ch, str); zend_tmp_string_release(tmp_str); return ret; @@ -2198,7 +2214,6 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue { zval *current; HashTable *ph; - zend_string *val, *tmp_val; struct curl_slist *slist = NULL; if (Z_TYPE_P(zvalue) != IS_ARRAY) { @@ -2209,7 +2224,12 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue ph = Z_ARRVAL_P(zvalue); ZEND_HASH_FOREACH_VAL(ph, current) { ZVAL_DEREF(current); - val = zval_get_tmp_string(current, &tmp_val); + zend_string *tmp_val; + zend_string *val = zval_try_get_tmp_string(current, &tmp_val); + if (UNEXPECTED(val == NULL)) { + zend_argument_type_error(2 + !is_array_config, "entries for option CURLOPT_%s must be of type string, %s given", php_curl_option_get_name(option), zend_zval_type_name(zvalue)); + return FAILURE; + } if (zend_str_has_nul_byte(val)) { curl_slist_free_all(slist); @@ -2258,7 +2278,11 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue } } else { zend_string *tmp_str; - zend_string *str = zval_get_tmp_string(zvalue, &tmp_str); + zend_string *str = zval_try_get_tmp_string(zvalue, &tmp_str); + if (UNEXPECTED(str == NULL)) { + zend_argument_type_error(2 + !is_array_config, "must be of type string|array for option CURLOPT_POSTFIELDS, %s given", zend_zval_type_name(zvalue)); + return FAILURE; + } /* with curl 7.17.0 and later, we can use COPYPOSTFIELDS, but we have to provide size before */ error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t) ZSTR_LEN(str)); error = curl_easy_setopt(ch->cp, CURLOPT_COPYPOSTFIELDS, ZSTR_VAL(str)); @@ -2321,7 +2345,13 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue case CURLOPT_SSH_KNOWNHOSTS: { zend_string *tmp_str; - zend_string *str = zval_get_tmp_string(zvalue, &tmp_str); + zend_string *str = zval_try_get_tmp_string(zvalue, &tmp_str); + if (UNEXPECTED(str == NULL)) { + zend_argument_type_error(2 + !is_array_config, + "must be of type string for option CURLOPT_%s, %s given", + php_curl_option_get_name(option), zend_zval_type_name(zvalue)); + return FAILURE; + } zend_result ret; if (ZSTR_LEN(str) && php_check_open_basedir(ZSTR_VAL(str))) { From dc7fdf0cddfbf0b7b8914e65d4a11e980b4c9554 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 1 Nov 2026 17:43:00 +0000 Subject: [PATCH 5/5] curl: normalize error when option value is not an array --- ext/curl/interface.c | 4 +++- ext/curl/tests/curl_setopt_basic003.phpt | 2 +- ext/curl/tests/curl_setopt_option_value_errors.phpt | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 6308c10b1e26..112f2a8c4f12 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -2217,7 +2217,9 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue struct curl_slist *slist = NULL; if (Z_TYPE_P(zvalue) != IS_ARRAY) { - zend_type_error("%s(): The CURLOPT_%s option must have an array value", get_active_function_name(), php_curl_option_get_name(option)); + zend_argument_type_error(2 + !is_array_config, + "must be of type array for option CURLOPT_%s, %s given", + php_curl_option_get_name(option), zend_zval_type_name(zvalue)); return FAILURE; } diff --git a/ext/curl/tests/curl_setopt_basic003.phpt b/ext/curl/tests/curl_setopt_basic003.phpt index daeac6b07c14..83e1e9193b1a 100644 --- a/ext/curl/tests/curl_setopt_basic003.phpt +++ b/ext/curl/tests/curl_setopt_basic003.phpt @@ -42,6 +42,6 @@ var_dump( $curl_content ); ?> --EXPECT-- *** curl_setopt() call with CURLOPT_HTTPHEADER -TypeError: curl_setopt(): The CURLOPT_HTTPHEADER option must have an array value +TypeError: curl_setopt(): Argument #3 ($value) must be of type array for option CURLOPT_HTTPHEADER, int given bool(false) bool(true) diff --git a/ext/curl/tests/curl_setopt_option_value_errors.phpt b/ext/curl/tests/curl_setopt_option_value_errors.phpt index 7e88444e2a7d..0e4a021387b6 100644 --- a/ext/curl/tests/curl_setopt_option_value_errors.phpt +++ b/ext/curl/tests/curl_setopt_option_value_errors.phpt @@ -9,7 +9,6 @@ const KNOWNS_ERRORS = [ 'curl_setopt(): Argument #2 ($option) is not a valid cURL option', 'curl_setopt(): supplied argument is not a valid File-Handle resource', 'Object of class stdClass could not be converted to string', - 'curl_setopt(): The CURLOPT_HTTP200ALIASES option must have an array value', 'curl_setopt(): Argument #3 ($value) must be of type CurlSharePersistentHandle|CurlShareHandle for option CURLOPT_SHARE, stdClass given', ]; @@ -25,7 +24,7 @@ function isKnownError($error): bool { return true; } if (preg_match( - '/curl_setopt\(\): The CURLOPT_([A-Z_])+ option must have an array value/', + '/curl_setopt\(\): Argument #3 \(\$value\) must be of type array for option CURLOPT_([A-Z0-9_])+, stdClass given/', $error, )) { return true;