summaryrefslogtreecommitdiff
path: root/Zend/zend_API.h
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 /Zend/zend_API.h
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 'Zend/zend_API.h')
-rw-r--r--Zend/zend_API.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 336060e576..9bb8957e8e 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -1215,8 +1215,8 @@ static zend_always_inline zval *zend_try_array_init(zval *zv)
_(Z_EXPECTED_FUNC_OR_NULL, "a valid callback or null") \
_(Z_EXPECTED_RESOURCE, "of type resource") \
_(Z_EXPECTED_RESOURCE_OR_NULL, "of type resource or null") \
- _(Z_EXPECTED_PATH, "a valid path") \
- _(Z_EXPECTED_PATH_OR_NULL, "a valid path or null") \
+ _(Z_EXPECTED_PATH, "of type string") \
+ _(Z_EXPECTED_PATH_OR_NULL, "of type ?string") \
_(Z_EXPECTED_OBJECT, "of type object") \
_(Z_EXPECTED_OBJECT_OR_NULL, "of type ?object") \
_(Z_EXPECTED_DOUBLE, "of type float") \