summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-02-26 18:59:29 +0000
committerZeev Suraski <zeev@php.net>2000-02-26 18:59:29 +0000
commite5c8aeb3f17dc49df22c0cda9723a6942d58749d (patch)
tree6bf9c2ef6b7e236b2f755a512b28b2334f8c31a0 /main
parentf7f7094bcf98600fd3f0c312de5fc148a6632055 (diff)
downloadphp-git-e5c8aeb3f17dc49df22c0cda9723a6942d58749d.tar.gz
- Protect $HTTP_POST_FILES[] as well
Diffstat (limited to 'main')
-rw-r--r--main/main.c6
-rw-r--r--main/php_globals.h1
-rw-r--r--main/rfc1867.c2
3 files changed, 6 insertions, 3 deletions
diff --git a/main/main.c b/main/main.c
index 31433062bc..511e6db494 100644
--- a/main/main.c
+++ b/main/main.c
@@ -956,7 +956,7 @@ static int php_hash_environment(ELS_D SLS_DC PLS_DC)
php_import_environment_variables(ELS_C PLS_CC);
}
- PG(http_globals).post = PG(http_globals).get = PG(http_globals).cookie = PG(http_globals).server = PG(http_globals).environment = NULL;
+ PG(http_globals).post = PG(http_globals).get = PG(http_globals).cookie = PG(http_globals).server = PG(http_globals).environment = PG(http_globals).post_files = NULL;
while(*p) {
switch(*p++) {
@@ -1013,7 +1013,9 @@ static int php_hash_environment(ELS_D SLS_DC PLS_DC)
if (PG(http_globals).environment) {
zend_hash_add_ptr(&EG(symbol_table), "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS"), PG(http_globals).environment, sizeof(zval *), NULL);
}
-
+ if (PG(http_globals).post_files) {
+ zend_hash_add_ptr(&EG(symbol_table), "HTTP_POST_FILES", sizeof("HTTP_POST_FILES"), PG(http_globals).post_files, sizeof(zval *),NULL);
+ }
if (!have_variables_order) {
php_register_server_variables(ELS_C SLS_CC PLS_CC);
diff --git a/main/php_globals.h b/main/php_globals.h
index 1a1a6db707..1c50a7c1be 100644
--- a/main/php_globals.h
+++ b/main/php_globals.h
@@ -48,6 +48,7 @@ typedef struct _php_http_globals {
zval *cookie;
zval *server;
zval *environment;
+ zval *post_files;
} php_http_globals;
struct _php_tick_function_entry;
diff --git a/main/rfc1867.c b/main/rfc1867.c
index d592dae4dc..3f183cb7d2 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -71,7 +71,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr)
ALLOC_ZVAL(http_post_files);
array_init(http_post_files);
INIT_PZVAL(http_post_files);
- zend_hash_add_ptr(&EG(symbol_table), "HTTP_POST_FILES", sizeof("HTTP_POST_FILES"), http_post_files, sizeof(zval *),NULL);
+ PG(http_globals).post_files = http_post_files;
}