summaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-07-13 17:52:00 +0000
committerZeev Suraski <zeev@php.net>2000-07-13 17:52:00 +0000
commitaa8d04a87cff069105ce5dec5b640570654a6fce (patch)
tree35dfed4dedc2d7548c15f08327f5e407134b4502 /main/main.c
parent155cac35d8d208a555a62469cf685c9bfe85c43b (diff)
downloadphp-git-aa8d04a87cff069105ce5dec5b640570654a6fce.tar.gz
Fix disable_functions feature
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/main/main.c b/main/main.c
index 0315918f1b..3330f63ca5 100644
--- a/main/main.c
+++ b/main/main.c
@@ -144,19 +144,18 @@ static PHP_INI_MH(OnUpdateErrorReporting)
}
-static PHP_INI_MH(OnDisableFunctions)
+static void php_disable_functions()
{
char *func;
- char *new_value_dup = zend_strndup(new_value, new_value_length); /* This is an intentional leak,
- * it's not a big deal as it's process-wide
- */
+ char *new_value_dup = strdup(INI_STR("disable_functions")); /* This is an intentional leak,
+ * it's not a big deal as it's process-wide
+ */
func = strtok(new_value_dup, ", ");
while (func) {
zend_disable_function(func, strlen(func));
func = strtok(NULL, ", ");
}
- return SUCCESS;
}
@@ -257,7 +256,7 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY("sendmail_from", NULL, PHP_INI_ALL, NULL)
PHP_INI_ENTRY("sendmail_path", DEFAULT_SENDMAIL_PATH, PHP_INI_SYSTEM, NULL)
- PHP_INI_ENTRY("disable_functions", "", PHP_INI_SYSTEM, OnDisableFunctions)
+ PHP_INI_ENTRY("disable_functions", "", PHP_INI_SYSTEM, NULL)
PHP_INI_END()
@@ -876,6 +875,7 @@ int php_module_startup(sapi_module_struct *sf)
php_printf("Unable to start builtin modules\n");
return FAILURE;
}
+ php_disable_functions();
module_initialized = 1;
sapi_deactivate(SLS_C);
return SUCCESS;