Fix bug #75712: getenv in php-fpm should not read $_ENV, $_SERVER

Closes GH-13195
This commit is contained in:
Jakub Zelenka 2024-01-19 14:41:46 +00:00
parent b06d6dba4f
commit bc30ae4f04
No known key found for this signature in database
GPG key ID: 1C0779DC5C0A9DE4
6 changed files with 91 additions and 3 deletions

View file

@ -28,7 +28,9 @@
/* for systems that need to override reading of environment variables */
void _php_import_environment_variables(zval *array_ptr);
void _php_load_environment_variables(zval *array_ptr);
PHPAPI void (*php_import_environment_variables)(zval *array_ptr) = _php_import_environment_variables;
PHPAPI void (*php_load_environment_variables)(zval *array_ptr) = _php_load_environment_variables;
PHPAPI void php_register_variable(const char *var, const char *strval, zval *track_vars_array)
{
@ -632,6 +634,11 @@ void _php_import_environment_variables(zval *array_ptr)
tsrm_env_unlock();
}
void _php_load_environment_variables(zval *array_ptr)
{
php_import_environment_variables(array_ptr);
}
bool php_std_auto_global_callback(char *name, uint32_t name_len)
{
zend_printf("%s\n", name);