]> granicus.if.org Git - php/commitdiff
- Protect $HTTP_POST_FILES[] as well
authorZeev Suraski <zeev@php.net>
Sat, 26 Feb 2000 18:59:29 +0000 (18:59 +0000)
committerZeev Suraski <zeev@php.net>
Sat, 26 Feb 2000 18:59:29 +0000 (18:59 +0000)
main/main.c
main/php_globals.h
main/rfc1867.c

index 31433062bcda338a549b8d77fac50755eb3d8a6b..511e6db4943998803cc99ea9ba4dc1781af51206 100644 (file)
@@ -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);
index 1a1a6db70774a23689af488631f7c64c946e73fc..1c50a7c1beadfdf189675f89d5af34015005ac3d 100644 (file)
@@ -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;
index d592dae4dc0dc80db9e69053152ea45c3496eb30..3f183cb7d20b650b42a4739b97abf77d826713c6 100644 (file)
@@ -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;
        }