Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug #26707 (Incorrect error for disabled functions/classes).

  • Loading branch information...
commit be5670af2b9aca5a8089d9d7fe28a4f8a6c5e14f 1 parent f95db00
Ilia Alshanetsky authored
Showing with 20 additions and 13 deletions.
  1. +16 −12 main/main.c
  2. +1 −1  main/php.h
  3. +3 −0  main/php_globals.h
28 main/main.c
View
@@ -131,23 +131,21 @@ 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;
}
+ e = PG(disable_functions) = 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;
@@ -169,23 +167,21 @@ 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;
}
+ e = PG(disable_classes) = 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;
@@ -1384,6 +1380,8 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
PG(last_error_file) = NULL;
PG(last_error_lineno) = 0;
PG(error_handling) = EH_NORMAL;
+ PG(disable_functions) = NULL;
+ PG(disable_classes) = NULL;
#if HAVE_SETLOCALE
setlocale(LC_CTYPE, "");
@@ -1552,6 +1550,12 @@ void php_module_shutdown(TSRMLS_D)
if (PG(last_error_file)) {
free(PG(last_error_file));
}
+ if (PG(disable_functions)) {
+ free(PG(disable_functions));
+ }
+ if (PG(disable_classes)) {
+ free(PG(disable_classes));
+ }
}
/* }}} */
2  main/php.h
View
@@ -26,7 +26,7 @@
#include <dmalloc.h>
#endif
-#define PHP_API_VERSION 20031103
+#define PHP_API_VERSION 20031224
#define PHP_HAVE_STREAMS
#define YYDEBUG 0
3  main/php_globals.h
View
@@ -147,6 +147,9 @@ struct _php_core_globals {
int last_error_lineno;
error_handling_t error_handling;
zend_class_entry *exception_class;
+
+ char *disable_functions;
+ char *disable_classes;
};
Please sign in to comment.
Something went wrong with that request. Please try again.