ext/standard: Use zend_string in is_uploaded_file()

This commit is contained in:
Gina Peter Banyard 2024-12-29 09:54:33 +00:00
parent 1c129c723d
commit 1e3498ea01

View file

@ -2329,18 +2329,17 @@ PHP_FUNCTION(unregister_tick_function)
/* {{{ Check if file was created by rfc1867 upload */ /* {{{ Check if file was created by rfc1867 upload */
PHP_FUNCTION(is_uploaded_file) PHP_FUNCTION(is_uploaded_file)
{ {
char *path; zend_string *path;
size_t path_len;
ZEND_PARSE_PARAMETERS_START(1, 1) ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_PATH(path, path_len) Z_PARAM_PATH_STR(path)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (!SG(rfc1867_uploaded_files)) { if (!SG(rfc1867_uploaded_files)) {
RETURN_FALSE; RETURN_FALSE;
} }
if (zend_hash_str_exists(SG(rfc1867_uploaded_files), path, path_len)) { if (zend_hash_exists(SG(rfc1867_uploaded_files), path)) {
RETURN_TRUE; RETURN_TRUE;
} else { } else {
RETURN_FALSE; RETURN_FALSE;