summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-09-08 21:56:47 +0000
committerZeev Suraski <zeev@php.net>2000-09-08 21:56:47 +0000
commit75086e3088ab06fbb2415e15490c216ac7c9c8b9 (patch)
treebb527e738a99e27af7778d80e5c1c0eb61d9f4de /ext
parent9a4c654606c28d43458f91212d11f19743142f44 (diff)
downloadphp-git-75086e3088ab06fbb2415e15490c216ac7c9c8b9.tar.gz
- Implemented is_upload_file()
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/basic_functions.c23
-rw-r--r--ext/standard/basic_functions.h2
2 files changed, 25 insertions, 0 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 02101d60f7..77374bdeed 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -356,6 +356,8 @@ function_entry basic_functions[] = {
PHP_FE(parse_ini_file, NULL)
+ PHP_FE(is_upload_file, NULL)
+
/* functions from reg.c */
PHP_FE(ereg, third_argument_force_ref)
PHP_FE(ereg_replace, NULL)
@@ -2205,6 +2207,27 @@ PHPAPI PHP_FUNCTION(warn_not_available)
}
+PHP_FUNCTION(is_upload_file)
+{
+ zval **path;
+ SLS_FETCH();
+
+ if (!SG(rfc1867_uploaded_files)) {
+ RETURN_FALSE;
+ }
+
+ if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &path)!=SUCCESS) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+ convert_to_string_ex(path);
+
+ if (zend_hash_exists(SG(rfc1867_uploaded_files), Z_STRVAL_PP(path), Z_STRLEN_PP(path)+1)) {
+ RETURN_TRUE;
+ } else {
+ RETURN_FALSE;
+ }
+}
+
/*
* Local variables:
* tab-width: 4
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index bf9e1b8dcd..e705a6de2a 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -109,6 +109,8 @@ PHP_FUNCTION(get_extension_funcs);
PHP_FUNCTION(register_tick_function);
PHP_FUNCTION(unregister_tick_function);
+PHP_FUNCTION(is_upload_file);
+
/* From the INI parser */
PHP_FUNCTION(parse_ini_file);