From 50d24746607efd7aaf63b9cfd0af7bf1ee909953 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Thu, 3 Apr 2003 18:10:41 +0000 Subject: [PATCH] MFH --- ext/standard/basic_functions.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index aa8e0c291f..2a1271c39c 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -2112,7 +2112,12 @@ PHP_FUNCTION(register_shutdown_function) if (zend_get_parameters_array(ht, shutdown_function_entry.arg_count, shutdown_function_entry.arguments) == FAILURE) { RETURN_FALSE; } - convert_to_string(shutdown_function_entry.arguments[0]); + + /* Prevent entering of anything but arrays/strings */ + if (Z_TYPE_P(shutdown_function_entry.arguments[0]) != IS_ARRAY) { + convert_to_string(shutdown_function_entry.arguments[0]); + } + if (!BG(user_shutdown_function_names)) { ALLOC_HASHTABLE(BG(user_shutdown_function_names)); zend_hash_init(BG(user_shutdown_function_names), 0, NULL, (void (*)(void *)) user_shutdown_function_dtor, 0); -- 2.40.0