summaryrefslogtreecommitdiff
path: root/main/php_variables.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/php_variables.c')
-rw-r--r--main/php_variables.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/main/php_variables.c b/main/php_variables.c
index 5ac61a4fa0..4b30d84f2f 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -370,9 +370,9 @@ SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler)
while (!php_stream_eof(s)) {
char buf[SAPI_POST_HANDLER_BUFSIZ] = {0};
- size_t len = php_stream_read(s, buf, SAPI_POST_HANDLER_BUFSIZ);
+ ssize_t len = php_stream_read(s, buf, SAPI_POST_HANDLER_BUFSIZ);
- if (len && len != (size_t) -1) {
+ if (len > 0) {
smart_str_appendl(&post_data.str, buf, len);
if (SUCCESS != add_post_vars(arr, &post_data, 0)) {
@@ -548,6 +548,8 @@ void _php_import_environment_variables(zval *array_ptr)
zval val;
zend_ulong idx;
+ tsrm_env_lock();
+
for (env = environ; env != NULL && *env != NULL; env++) {
p = strchr(*env, '=');
if (!p
@@ -572,6 +574,8 @@ void _php_import_environment_variables(zval *array_ptr)
php_register_variable_quick(*env, name_len, &val, Z_ARRVAL_P(array_ptr));
}
}
+
+ tsrm_env_unlock();
}
zend_bool php_std_auto_global_callback(char *name, uint32_t name_len)
@@ -915,12 +919,3 @@ void php_startup_auto_globals(void)
zend_register_auto_global(zend_string_init_interned("_REQUEST", sizeof("_REQUEST")-1, 1), PG(auto_globals_jit), php_auto_globals_create_request);
zend_register_auto_global(zend_string_init_interned("_FILES", sizeof("_FILES")-1, 1), 0, php_auto_globals_create_files);
}
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: sw=4 ts=4 fdm=marker
- * vim<600: sw=4 ts=4
- */