summaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/main/main.c b/main/main.c
index 76c8d83de2..fdeeb5747a 100644
--- a/main/main.c
+++ b/main/main.c
@@ -148,6 +148,22 @@ static PHP_INI_MH(OnUpdateErrorReporting)
}
+static PHP_INI_MH(OnDisableFunctions)
+{
+ 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
+ */
+
+ func = strtok(new_value_dup, ", ");
+ while (func) {
+ zend_disable_function(func, strlen(func));
+ func = strtok(NULL, ", ");
+ }
+ return SUCCESS;
+}
+
+
/* Need to convert to strings and make use of:
* DEFAULT_SHORT_OPEN_TAG
* PHP_SAFE_MODE
@@ -232,6 +248,8 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY("precision", "14", PHP_INI_ALL, OnSetPrecision)
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_END()