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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main/php_variables.c b/main/php_variables.c
index 3854c54880..c1fb36d6ad 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -542,7 +542,7 @@ void _php_import_environment_variables(zval *array_ptr)
}
}
-zend_bool php_std_auto_global_callback(char *name, uint name_len)
+zend_bool php_std_auto_global_callback(char *name, uint32_t name_len)
{
zend_printf("%s\n", name);
return 0; /* don't rearm */
@@ -801,6 +801,11 @@ static zend_bool php_auto_globals_create_server(zend_string *name)
zend_hash_update(&EG(symbol_table), name, &PG(http_globals)[TRACK_VARS_SERVER]);
Z_ADDREF(PG(http_globals)[TRACK_VARS_SERVER]);
+ /* TODO: TRACK_VARS_SERVER is modified in a number of places (e.g. phar) past this point,
+ * where rc>1 due to the $_SERVER global. Ideally this shouldn't happen, but for now we
+ * ignore this issue, as it would probably require larger changes. */
+ HT_ALLOW_COW_VIOLATION(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]));
+
return 0; /* don't rearm */
}