Use new helper function for "cannot be empty" ValueErrors

This commit is contained in:
Gina Peter Bnayard 2024-08-18 20:09:08 +02:00 committed by Gina Peter Banyard
parent 96d572a18e
commit e7c4d54d65
40 changed files with 96 additions and 96 deletions

View file

@ -349,7 +349,7 @@ PHP_FUNCTION(bzopen)
/* If it's not a resource its a string containing the filename to open */ /* If it's not a resource its a string containing the filename to open */
if (Z_TYPE_P(file) == IS_STRING) { if (Z_TYPE_P(file) == IS_STRING) {
if (Z_STRLEN_P(file) == 0) { if (Z_STRLEN_P(file) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -547,15 +547,15 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
} }
if (ZSTR_LEN(path) == 0) { if (ZSTR_LEN(path) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
if (ZSTR_LEN(mode) == 0) { if (ZSTR_LEN(mode) == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
if (handler_str && ZSTR_LEN(handler_str) == 0) { if (handler_str && ZSTR_LEN(handler_str) == 0) {
zend_argument_value_error(3, "cannot be empty"); zend_argument_cannot_be_empty_error(3);
RETURN_THROWS(); RETURN_THROWS();
} }
// TODO Check Value for permission // TODO Check Value for permission
@ -640,7 +640,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
// bool is_file_lock = false; // bool is_file_lock = false;
if (ZSTR_LEN(mode) == 0) { if (ZSTR_LEN(mode) == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
efree(resource_key); efree(resource_key);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -64,7 +64,7 @@ PHP_METHOD(DOMImplementation, createDocumentType)
} }
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -411,7 +411,7 @@ PHP_METHOD(DOMElement, setAttribute)
} }
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -903,7 +903,7 @@ PHP_METHOD(DOMElement, getAttributeNS)
static void dom_set_attribute_ns_legacy(dom_object *intern, xmlNodePtr elemp, char *uri, size_t uri_len, char *name, size_t name_len, const char *value) static void dom_set_attribute_ns_legacy(dom_object *intern, xmlNodePtr elemp, char *uri, size_t uri_len, char *name, size_t name_len, const char *value)
{ {
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
return; return;
} }

View file

@ -447,7 +447,7 @@ PHP_FUNCTION(enchant_broker_request_dict)
PHP_ENCHANT_GET_BROKER; PHP_ENCHANT_GET_BROKER;
if (taglen == 0) { if (taglen == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -4550,7 +4550,7 @@ PHP_FUNCTION(exif_read_data)
} }
if (!Z_STRLEN_P(stream)) { if (!Z_STRLEN_P(stream)) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -4727,7 +4727,7 @@ PHP_FUNCTION(exif_thumbnail)
} }
if (!Z_STRLEN_P(stream)) { if (!Z_STRLEN_P(stream)) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -374,7 +374,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
php_stream_statbuf ssb; php_stream_statbuf ssb;
if (buffer == NULL || buffer_len == 0) { if (buffer == NULL || buffer_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
goto clean; goto clean;
} }
if (CHECK_NULL_PATH(buffer, buffer_len)) { if (CHECK_NULL_PATH(buffer, buffer_len)) {

View file

@ -646,7 +646,7 @@ PHP_FUNCTION(imagesetstyle)
num_styles = zend_hash_num_elements(Z_ARRVAL_P(styles)); num_styles = zend_hash_num_elements(Z_ARRVAL_P(styles));
if (num_styles == 0) { if (num_styles == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -55,7 +55,7 @@ ZEND_GET_MODULE(php_gettext)
zend_argument_value_error(_arg_num, "is too long"); \ zend_argument_value_error(_arg_num, "is too long"); \
RETURN_THROWS(); \ RETURN_THROWS(); \
} else if (domain_len == 0) { \ } else if (domain_len == 0) { \
zend_argument_value_error(_arg_num, "cannot be empty"); \ zend_argument_cannot_be_empty_error(_arg_num); \
RETURN_THROWS(); \ RETURN_THROWS(); \
} }
@ -191,7 +191,7 @@ PHP_FUNCTION(bindtextdomain)
PHP_GETTEXT_DOMAIN_LENGTH_CHECK(1, ZSTR_LEN(domain)) PHP_GETTEXT_DOMAIN_LENGTH_CHECK(1, ZSTR_LEN(domain))
if (!ZSTR_LEN(domain)) { if (!ZSTR_LEN(domain)) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -313,7 +313,7 @@ PHP_FUNCTION(bind_textdomain_codeset)
PHP_GETTEXT_DOMAIN_LENGTH_CHECK(1, ZSTR_LEN(domain)) PHP_GETTEXT_DOMAIN_LENGTH_CHECK(1, ZSTR_LEN(domain))
if (!ZSTR_LEN(domain)) { if (!ZSTR_LEN(domain)) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -914,7 +914,7 @@ PHP_FUNCTION(hash_hkdf)
} }
if (ZSTR_LEN(ikm) == 0) { if (ZSTR_LEN(ikm) == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -125,7 +125,7 @@ static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(domain) == 0) { if (ZSTR_LEN(domain) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
if (ZSTR_LEN(domain) > INT32_MAX - 1) { if (ZSTR_LEN(domain) > INT32_MAX - 1) {

View file

@ -186,7 +186,7 @@ static zval *resource_bundle_array_fetch(
if (offset_str) { if (offset_str) {
if (UNEXPECTED(ZSTR_LEN(offset_str) == 0)) { if (UNEXPECTED(ZSTR_LEN(offset_str) == 0)) {
if (offset_arg_num) { if (offset_arg_num) {
zend_argument_value_error(offset_arg_num, "cannot be empty"); zend_argument_cannot_be_empty_error(offset_arg_num);
} else { } else {
zend_value_error("Offset cannot be empty"); zend_value_error("Offset cannot be empty");
} }

View file

@ -1501,7 +1501,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
nlinks = zend_hash_num_elements(Z_ARRVAL_P(link)); nlinks = zend_hash_num_elements(Z_ARRVAL_P(link));
if (nlinks == 0) { if (nlinks == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
ret = 0; ret = 0;
goto cleanup; goto cleanup;
} }

View file

@ -139,7 +139,7 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
if (!types_len) { if (!types_len) {
zend_argument_value_error(ERROR_ARG_POS(2), "cannot be empty"); zend_argument_cannot_be_empty_error(ERROR_ARG_POS(2));
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -572,7 +572,7 @@ PHP_FUNCTION(mysqli_query)
} }
if (!query_len) { if (!query_len) {
zend_argument_value_error(ERROR_ARG_POS(2), "cannot be empty"); zend_argument_cannot_be_empty_error(ERROR_ARG_POS(2));
RETURN_THROWS(); RETURN_THROWS();
} }
if ((resultmode & ~MYSQLI_ASYNC) != MYSQLI_USE_RESULT && if ((resultmode & ~MYSQLI_ASYNC) != MYSQLI_USE_RESULT &&
@ -1013,7 +1013,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
RETURN_THROWS(); RETURN_THROWS();
} }
if (name && !name_len) { if (name && !name_len) {
zend_argument_value_error(ERROR_ARG_POS(3), "cannot be empty"); zend_argument_cannot_be_empty_error(ERROR_ARG_POS(3));
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1037,7 +1037,7 @@ PHP_FUNCTION(mysqli_savepoint)
} }
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(ERROR_ARG_POS(2), "cannot be empty"); zend_argument_cannot_be_empty_error(ERROR_ARG_POS(2));
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1061,7 +1061,7 @@ PHP_FUNCTION(mysqli_release_savepoint)
} }
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(ERROR_ARG_POS(2), "cannot be empty"); zend_argument_cannot_be_empty_error(ERROR_ARG_POS(2));
RETURN_THROWS(); RETURN_THROWS();
} }
if (FAIL == mysqlnd_release_savepoint(mysql->mysql, name)) { if (FAIL == mysqlnd_release_savepoint(mysql->mysql, name)) {

View file

@ -7243,7 +7243,7 @@ PHP_FUNCTION(openssl_seal)
pubkeysht = Z_ARRVAL_P(pubkeys); pubkeysht = Z_ARRVAL_P(pubkeys);
nkeys = pubkeysht ? zend_hash_num_elements(pubkeysht) : 0; nkeys = pubkeysht ? zend_hash_num_elements(pubkeysht) : 0;
if (!nkeys) { if (!nkeys) {
zend_argument_value_error(4, "cannot be empty"); zend_argument_cannot_be_empty_error(4);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -8017,7 +8017,7 @@ PHP_FUNCTION(openssl_decrypt)
} }
if (!method_len) { if (!method_len) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -8059,7 +8059,7 @@ PHP_FUNCTION(openssl_cipher_iv_length)
} }
if (ZSTR_LEN(method) == 0) { if (ZSTR_LEN(method) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -8088,7 +8088,7 @@ PHP_FUNCTION(openssl_cipher_key_length)
} }
if (ZSTR_LEN(method) == 0) { if (ZSTR_LEN(method) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -860,7 +860,7 @@ static bool php_pcntl_set_user_signal_infos(
bool allow_empty_signal_array bool allow_empty_signal_array
) { ) {
if (!allow_empty_signal_array && zend_hash_num_elements(user_signals) == 0) { if (!allow_empty_signal_array && zend_hash_num_elements(user_signals) == 0) {
zend_argument_value_error(arg_num, "cannot be empty"); zend_argument_cannot_be_empty_error(arg_num);
return false; return false;
} }

View file

@ -563,7 +563,7 @@ PHP_METHOD(PDO, prepare)
PDO_CONSTRUCT_CHECK; PDO_CONSTRUCT_CHECK;
if (ZSTR_LEN(statement) == 0) { if (ZSTR_LEN(statement) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1030,7 +1030,7 @@ PHP_METHOD(PDO, exec)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(statement) == 0) { if (ZSTR_LEN(statement) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1166,7 +1166,7 @@ PHP_METHOD(PDO, query)
PDO_CONSTRUCT_CHECK; PDO_CONSTRUCT_CHECK;
if (ZSTR_LEN(statement) == 0) { if (ZSTR_LEN(statement) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -1423,7 +1423,7 @@ static void register_bound_param(INTERNAL_FUNCTION_PARAMETERS, int is_param) /*
if (param.name) { if (param.name) {
if (ZSTR_LEN(param.name) == 0) { if (ZSTR_LEN(param.name) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
param.paramno = -1; param.paramno = -1;
@ -1471,7 +1471,7 @@ PHP_METHOD(PDOStatement, bindValue)
if (param.name) { if (param.name) {
if (ZSTR_LEN(param.name) == 0) { if (ZSTR_LEN(param.name) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
param.paramno = -1; param.paramno = -1;

View file

@ -627,7 +627,7 @@ void pgsqlCopyFromArray_internal(INTERNAL_FUNCTION_PARAMETERS)
} }
if (!zend_hash_num_elements(Z_ARRVAL_P(pg_rows))) { if (!zend_hash_num_elements(Z_ARRVAL_P(pg_rows))) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -82,7 +82,7 @@ PHP_METHOD(Pdo_Sqlite, loadExtension)
} }
if (extension_len == 0) { if (extension_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -4613,7 +4613,7 @@ PHP_FUNCTION(pg_meta_data)
/* php_pgsql_meta_data() asserts that table_name is not empty */ /* php_pgsql_meta_data() asserts that table_name is not empty */
if (ZSTR_LEN(table_name) == 0) { if (ZSTR_LEN(table_name) == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -5405,7 +5405,7 @@ PHP_FUNCTION(pg_convert)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(table_name) == 0) { if (ZSTR_LEN(table_name) == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -5618,7 +5618,7 @@ PHP_FUNCTION(pg_insert)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(table) == 0) { if (ZSTR_LEN(table) == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -5840,7 +5840,7 @@ PHP_FUNCTION(pg_update)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(table) == 0) { if (ZSTR_LEN(table) == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -5939,7 +5939,7 @@ PHP_FUNCTION(pg_delete)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(table) == 0) { if (ZSTR_LEN(table) == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -6095,7 +6095,7 @@ PHP_FUNCTION(pg_select)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(table) == 0) { if (ZSTR_LEN(table) == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -6143,13 +6143,13 @@ PHP_FUNCTION(pg_change_password)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(user) == 0) { if (ZSTR_LEN(user) == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
/* it is technically possible, but better to disallow it */ /* it is technically possible, but better to disallow it */
if (ZSTR_LEN(passwd) == 0) { if (ZSTR_LEN(passwd) == 0) {
zend_argument_value_error(3, "cannot be empty"); zend_argument_cannot_be_empty_error(3);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -746,7 +746,7 @@ PHP_FUNCTION(posix_eaccess)
path = expand_filepath(filename, NULL); path = expand_filepath(filename, NULL);
if (!path) { if (!path) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1285,7 +1285,7 @@ PHP_FUNCTION(posix_pathconf)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (path_len == 0) { if (path_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} else if (php_check_open_basedir(path)) { } else if (php_check_open_basedir(path)) {
php_error_docref(NULL, E_WARNING, "Invalid path supplied: %s", path); php_error_docref(NULL, E_WARNING, "Invalid path supplied: %s", path);

View file

@ -434,7 +434,7 @@ PHP_METHOD(Random_Randomizer, getBytesFromString)
const size_t max_offset = source_length - 1; const size_t max_offset = source_length - 1;
if (source_length < 1) { if (source_length < 1) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -1667,7 +1667,7 @@ PHP_METHOD(SimpleXMLElement, addChild)
} }
if (qname_len == 0) { if (qname_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1734,7 +1734,7 @@ PHP_METHOD(SimpleXMLElement, addAttribute)
} }
if (qname_len == 0) { if (qname_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -571,7 +571,7 @@ PHP_METHOD(SoapParam, __construct)
} }
if (ZSTR_LEN(name) == 0) { if (ZSTR_LEN(name) == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -602,11 +602,11 @@ PHP_METHOD(SoapHeader, __construct)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(ns) == 0) { if (ZSTR_LEN(ns) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
if (ZSTR_LEN(name) == 0) { if (ZSTR_LEN(name) == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -696,7 +696,7 @@ static void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_l
} }
if (ZSTR_LEN(path) == 0) { if (ZSTR_LEN(path) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -421,7 +421,7 @@ PHP_METHOD(SQLite3, loadExtension)
} }
if (extension_len == 0) { if (extension_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -6211,7 +6211,7 @@ PHPAPI bool php_array_pick_keys(php_random_algo_with_state engine, zval *input,
if (num_avail == 0) { if (num_avail == 0) {
if (!silent) { if (!silent) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
} }
return false; return false;
} }

View file

@ -2500,7 +2500,7 @@ PHP_FUNCTION(parse_ini_file)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(filename) == 0) { if (ZSTR_LEN(filename) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -467,7 +467,7 @@ PHP_FUNCTION(scandir)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (dirn_len < 1) { if (dirn_len < 1) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -388,7 +388,7 @@ PHP_FUNCTION(dns_check_record)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (hostname_len == 0) { if (hostname_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -108,7 +108,7 @@ PHP_FUNCTION(dns_check_record)
} }
if (hostname_len == 0) { if (hostname_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -218,7 +218,7 @@ static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (!cmd_len) { if (!cmd_len) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
if (strlen(cmd) != cmd_len) { if (strlen(cmd) != cmd_len) {
@ -518,7 +518,7 @@ PHP_FUNCTION(shell_exec)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (!command_len) { if (!command_len) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
if (strlen(command) != command_len) { if (strlen(command) != command_len) {

View file

@ -40,7 +40,7 @@ PHP_FUNCTION(ftok)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (pathname_len == 0){ if (pathname_len == 0){
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -87,7 +87,7 @@ PHPAPI zend_result php_setcookie(zend_string *name, zend_string *value, time_t e
smart_str buf = {0}; smart_str buf = {0};
if (!ZSTR_LEN(name)) { if (!ZSTR_LEN(name)) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
return FAILURE; return FAILURE;
} }
if (strpbrk(ZSTR_VAL(name), "=,; \t\r\n\013\014") != NULL) { /* man isspace for \013 and \014 */ if (strpbrk(ZSTR_VAL(name), "=,; \t\r\n\013\014") != NULL) { /* man isspace for \013 and \014 */

View file

@ -724,7 +724,7 @@ PHP_FUNCTION(wordwrap)
} }
if (breakchar_len == 0) { if (breakchar_len == 0) {
zend_argument_value_error(3, "cannot be empty"); zend_argument_cannot_be_empty_error(3);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -930,7 +930,7 @@ PHP_FUNCTION(explode)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(delim) == 0) { if (ZSTR_LEN(delim) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1277,7 +1277,7 @@ PHP_FUNCTION(str_increment)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(str) == 0) { if (ZSTR_LEN(str) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
if (!zend_string_only_has_ascii_alphanumeric(str)) { if (!zend_string_only_has_ascii_alphanumeric(str)) {
@ -1333,7 +1333,7 @@ PHP_FUNCTION(str_decrement)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (ZSTR_LEN(str) == 0) { if (ZSTR_LEN(str) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
if (!zend_string_only_has_ascii_alphanumeric(str)) { if (!zend_string_only_has_ascii_alphanumeric(str)) {
@ -5727,7 +5727,7 @@ PHP_FUNCTION(substr_count)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (needle_len == 0) { if (needle_len == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -382,7 +382,7 @@ static void php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_rea
} }
if (!name_len) { if (!name_len) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -467,7 +467,7 @@ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int t
} }
if (source != NULL && !source_len) { if (source != NULL && !source_len) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -574,12 +574,12 @@ PHP_METHOD(XMLReader, getAttributeNs)
} }
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
if (ns_uri_len == 0) { if (ns_uri_len == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -655,7 +655,7 @@ PHP_METHOD(XMLReader, moveToAttribute)
} }
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -715,12 +715,12 @@ PHP_METHOD(XMLReader, moveToAttributeNs)
} }
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
if (ns_uri_len == 0) { if (ns_uri_len == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -860,7 +860,7 @@ static void xml_reader_from_uri(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *
} }
if (!source_len) { if (!source_len) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1027,7 +1027,7 @@ PHP_METHOD(XMLReader, setSchema)
} }
if (source != NULL && !source_len) { if (source != NULL && !source_len) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1132,7 +1132,7 @@ static void xml_reader_from_string(INTERNAL_FUNCTION_PARAMETERS, zend_class_entr
} }
if (!source_len) { if (!source_len) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -817,7 +817,7 @@ PHP_FUNCTION(xmlwriter_open_uri)
} }
if (source_len == 0) { if (source_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -858,7 +858,7 @@ PHP_METHOD(XMLWriter, toUri)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (source_len == 0) { if (source_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -56,7 +56,7 @@ static int le_zip_entry;
This is always used for the first argument*/ This is always used for the first argument*/
#define PHP_ZIP_STAT_PATH(za, path, path_len, flags, sb) \ #define PHP_ZIP_STAT_PATH(za, path, path_len, flags, sb) \
if (path_len == 0) { \ if (path_len == 0) { \
zend_argument_value_error(1, "cannot be empty"); \ zend_argument_cannot_be_empty_error(1); \
RETURN_THROWS(); \ RETURN_THROWS(); \
} \ } \
if (zip_stat(za, path, flags, &sb) != 0) { \ if (zip_stat(za, path, flags, &sb) != 0) { \
@ -1184,7 +1184,7 @@ PHP_FUNCTION(zip_open)
} }
if (ZSTR_LEN(filename) == 0) { if (ZSTR_LEN(filename) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1466,7 +1466,7 @@ PHP_METHOD(ZipArchive, open)
ze_obj = Z_ZIP_P(self); ze_obj = Z_ZIP_P(self);
if (ZSTR_LEN(filename) == 0) { if (ZSTR_LEN(filename) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1753,7 +1753,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
} }
if (ZSTR_LEN(pattern) == 0) { if (ZSTR_LEN(pattern) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
if (options && zend_hash_num_elements(options) > 0 && (php_zip_parse_options(options, &opts) < 0)) { if (options && zend_hash_num_elements(options) > 0 && (php_zip_parse_options(options, &opts) < 0)) {
@ -1871,7 +1871,7 @@ PHP_METHOD(ZipArchive, addFile)
} }
if (ZSTR_LEN(filename) == 0) { if (ZSTR_LEN(filename) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1904,7 +1904,7 @@ PHP_METHOD(ZipArchive, replaceFile)
} }
if (ZSTR_LEN(filename) == 0) { if (ZSTR_LEN(filename) == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -2168,7 +2168,7 @@ PHP_METHOD(ZipArchive, setCommentName)
} }
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -2235,7 +2235,7 @@ PHP_METHOD(ZipArchive, setExternalAttributesName)
ZIP_FROM_OBJECT(intern, self); ZIP_FROM_OBJECT(intern, self);
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -2296,7 +2296,7 @@ PHP_METHOD(ZipArchive, getExternalAttributesName)
ZIP_FROM_OBJECT(intern, self); ZIP_FROM_OBJECT(intern, self);
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -2363,7 +2363,7 @@ PHP_METHOD(ZipArchive, setEncryptionName)
ZIP_FROM_OBJECT(intern, self); ZIP_FROM_OBJECT(intern, self);
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -2424,7 +2424,7 @@ PHP_METHOD(ZipArchive, getCommentName)
ZIP_FROM_OBJECT(intern, self); ZIP_FROM_OBJECT(intern, self);
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -2480,7 +2480,7 @@ PHP_METHOD(ZipArchive, setCompressionName)
ZIP_FROM_OBJECT(intern, this); ZIP_FROM_OBJECT(intern, this);
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -2540,7 +2540,7 @@ PHP_METHOD(ZipArchive, setMtimeName)
ZIP_FROM_OBJECT(intern, this); ZIP_FROM_OBJECT(intern, this);
if (name_len == 0) { if (name_len == 0) {
zend_argument_value_error(1, "cannot be empty"); zend_argument_cannot_be_empty_error(1);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -2654,7 +2654,7 @@ PHP_METHOD(ZipArchive, renameIndex)
ZIP_FROM_OBJECT(intern, self); ZIP_FROM_OBJECT(intern, self);
if (new_name_len == 0) { if (new_name_len == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }
@ -2682,7 +2682,7 @@ PHP_METHOD(ZipArchive, renameName)
ZIP_FROM_OBJECT(intern, self); ZIP_FROM_OBJECT(intern, self);
if (new_name_len == 0) { if (new_name_len == 0) {
zend_argument_value_error(2, "cannot be empty"); zend_argument_cannot_be_empty_error(2);
RETURN_THROWS(); RETURN_THROWS();
} }