diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-12-24 16:43:23 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-12-24 16:43:23 +0000 |
commit | 9235a5d001c0ead5e395858fd7de52ef68cba770 (patch) | |
tree | a351ba4d91c7109d3906a0f9b7d8daa9b513f256 | |
parent | 2a7a76c93e7dce061d2f49bd558edae13caaf856 (diff) | |
download | php-git-9235a5d001c0ead5e395858fd7de52ef68cba770.tar.gz |
MFH: Fixed bug #26707 (Incorrect error for disabled functions/classes).
# Direct MFH of the patch in PHP 5.0 cannot be used because that would
# require the change of API. So we'll need to make do with a one time
# (small) memory leak on startup when disable_functions and/or classes are
# used.
-rw-r--r-- | main/main.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/main/main.c b/main/main.c index 318842adba..a8eb6e9fae 100644 --- a/main/main.c +++ b/main/main.c @@ -165,23 +165,22 @@ static PHP_INI_MH(OnChangeMemoryLimit) */ static void php_disable_functions(TSRMLS_D) { - char *s = NULL; - char *e = INI_STR("disable_functions"); - char p; + char *s = NULL, *e; - if (!*e) { + if (!*(INI_STR("disable_functions"))) { return; } + /* Intentional one time memory leak on startup */ + e = strdup(INI_STR("disable_functions")); + while (*e) { switch (*e) { case ' ': case ',': if (s) { - p = *e; *e = '\0'; zend_disable_function(s, e-s TSRMLS_CC); - *e = p; s = NULL; } break; @@ -203,23 +202,22 @@ static void php_disable_functions(TSRMLS_D) */ static void php_disable_classes(TSRMLS_D) { - char *s = NULL; - char *e = INI_STR("disable_classes"); - char p; + char *s = NULL, *e; - if (!*e) { + if (!*(INI_STR("disable_classes"))) { return; } + /* Intentional one time memory leak on startup */ + e = strdup(INI_STR("disable_classes")); + while (*e) { switch (*e) { case ' ': case ',': if (s) { - p = *e; *e = '\0'; zend_disable_class(s, e-s TSRMLS_CC); - *e = p; s = NULL; } break; |