summaryrefslogtreecommitdiff
path: root/ext/sqlite3
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-04-01 23:32:39 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-04-06 10:41:01 +0200
commit50765075db6b6d5a9597589601c59f743f6ee9c8 (patch)
tree29ef6350004c95c3df9577e47ceaa1458e60921e /ext/sqlite3
parent21cfa03f1740042d0c48269430e0490e319e1408 (diff)
downloadphp-git-50765075db6b6d5a9597589601c59f743f6ee9c8.tar.gz
Improve some ValueError messages
Closes GH-5340
Diffstat (limited to 'ext/sqlite3')
-rw-r--r--ext/sqlite3/sqlite3.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index 0d5fc6de08..18dddd962d 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -1299,7 +1299,7 @@ PHP_METHOD(sqlite3, openBlob)
}
if (ZEND_NUM_ARGS() >= 4 && CHECK_NULL_PATH(dbname, dbname_len)) {
- zend_value_error("dbname must not contain null bytes");
+ zend_argument_type_error(4, "must not contain null bytes");
RETURN_THROWS();
}
@@ -1405,10 +1405,13 @@ PHP_METHOD(sqlite3, backup)
RETURN_THROWS();
}
- if ((ZEND_NUM_ARGS() >= 2 && CHECK_NULL_PATH(source_dbname, source_dbname_length))
- || (ZEND_NUM_ARGS() >= 3 && CHECK_NULL_PATH(destination_dbname, destination_dbname_length))
- ) {
- zend_value_error("dbname must not contain null bytes");
+ if (ZEND_NUM_ARGS() >= 2 && CHECK_NULL_PATH(source_dbname, source_dbname_length)) {
+ zend_argument_type_error(2, "must not contain null bytes");
+ RETURN_THROWS();
+ }
+
+ if (ZEND_NUM_ARGS() >= 3 && CHECK_NULL_PATH(destination_dbname, destination_dbname_length)) {
+ zend_argument_type_error(3, "must not contain null bytes");
RETURN_THROWS();
}