summaryrefslogtreecommitdiff
path: root/ext/curl/interface.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-09-08 12:12:26 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-09-08 15:23:23 +0200
commit7e339a335e87d9c8d0b6994039220890284df63e (patch)
tree4f4445f74094e6c614e1f536024be68f20518d37 /ext/curl/interface.c
parent2386f655d8181456c66241fd8ceb008bd995a31c (diff)
downloadphp-git-7e339a335e87d9c8d0b6994039220890284df63e.tar.gz
Make null byte error a ValueError
Currently we treat paths with null bytes as a TypeError, which is incorrect, and rather inconsistent, as we treat empty paths as ValueError. We do this because the error is generated by zpp and it's easier to always throw TypeError there. This changes the zpp implementation to throw a TypeError only if the type is actually wrong and throw ValueError for null bytes. The error message is also split accordingly, to be more precise. Closes GH-6094.
Diffstat (limited to 'ext/curl/interface.c')
-rw-r--r--ext/curl/interface.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 09e02b3ba5..150f98d46f 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -102,7 +102,7 @@ static int php_curl_option_str(php_curl *ch, zend_long option, const char *str,
CURLcode error = CURLE_OK;
if (strlen(str) != len) {
- zend_type_error("%s(): cURL option cannot contain any null-bytes", get_active_function_name());
+ zend_value_error("%s(): cURL option must not contain any null bytes", get_active_function_name());
return FAILURE;
}