summaryrefslogtreecommitdiff
path: root/ext/hash/hash.c
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-03-18 20:58:37 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-03-24 10:22:29 +0100
commitd5871e26ad95a8022aa68d0ca95d05398bf78a41 (patch)
tree5d51b2b897a75277f1a8b84e097099eee6800993 /ext/hash/hash.c
parenta42e8e8ec40ca79032e22dfc544b83986b55a239 (diff)
downloadphp-git-d5871e26ad95a8022aa68d0ca95d05398bf78a41.tar.gz
Promote warnings to exceptions in ext/hash
Diffstat (limited to 'ext/hash/hash.c')
-rw-r--r--ext/hash/hash.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index e4f8537676..7ff7a312b9 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -132,13 +132,13 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_
ops = php_hash_fetch_ops(algo);
if (!ops) {
- php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", ZSTR_VAL(algo));
- RETURN_FALSE;
+ zend_argument_value_error(1, "must be a valid hashing algorithm");
+ RETURN_THROWS();
}
if (isfilename) {
if (CHECK_NULL_PATH(data, data_len)) {
- php_error_docref(NULL, E_WARNING, "Invalid path");
- RETURN_FALSE;
+ zend_argument_value_error(1, "must be a valid path");
+ RETURN_THROWS();
}
stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, FG(default_context));
if (!stream) {
@@ -1065,8 +1065,8 @@ PHP_FUNCTION(mhash_keygen_s2k)
bytes = (int)l_bytes;
if (bytes <= 0){
- php_error_docref(NULL, E_WARNING, "The byte parameter must be greater than 0");
- RETURN_FALSE;
+ zend_argument_value_error(4, "must be a greater than 0");
+ RETURN_THROWS();
}
salt_len = MIN(salt_len, SALT_SIZE);