summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorDerick Rethans <github@derickrethans.nl>2012-08-24 10:56:03 +0200
committerDerick Rethans <github@derickrethans.nl>2012-08-24 10:56:03 +0200
commitbc602495d7e15f3684aaff22b96e9dfb1122b424 (patch)
treea994c9f36fdb744dbd55058b41c827f7b1aaa04a /Zend/zend_API.c
parentde59314a60e6503550546f38fc6ebb141d2fbfdb (diff)
parent21f085720cbb8967d6f7826a18e2ce71b6f0e216 (diff)
downloadphp-git-bc602495d7e15f3684aaff22b96e9dfb1122b424.tar.gz
Merge branch 'PHP-5.4' of git.php.net:/php-src into PHP-5.4
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 98a33e5445..a231415547 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2531,6 +2531,9 @@ ZEND_API int zend_disable_function(char *function_name, uint function_name_lengt
}
/* }}} */
+#ifdef ZEND_WIN32
+#pragma optimize("", off)
+#endif
static zend_object_value display_disabled_class(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
{
zend_object_value retval;
@@ -2539,6 +2542,9 @@ static zend_object_value display_disabled_class(zend_class_entry *class_type TSR
zend_error(E_WARNING, "%s() has been disabled for security reasons", class_type->name);
return retval;
}
+#ifdef ZEND_WIN32
+#pragma optimize("", on)
+#endif
/* }}} */
static const zend_function_entry disabled_class_new[] = {
@@ -2547,16 +2553,15 @@ static const zend_function_entry disabled_class_new[] = {
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */
{
- zend_class_entry disabled_class;
+ zend_class_entry **disabled_class;
zend_str_tolower(class_name, class_name_length);
- if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) {
+ if (zend_hash_find(CG(class_table), class_name, class_name_length+1, (void **)&disabled_class)==FAILURE) {
return FAILURE;
}
- INIT_OVERLOADED_CLASS_ENTRY_EX(disabled_class, class_name, class_name_length, disabled_class_new, NULL, NULL, NULL, NULL, NULL);
- disabled_class.create_object = display_disabled_class;
- disabled_class.name_length = class_name_length;
- zend_register_internal_class(&disabled_class TSRMLS_CC);
+ INIT_CLASS_ENTRY_INIT_METHODS((**disabled_class), disabled_class_new, NULL, NULL, NULL, NULL, NULL);
+ (*disabled_class)->create_object = display_disabled_class;
+ zend_hash_clean(&((*disabled_class)->function_table));
return SUCCESS;
}
/* }}} */
@@ -2630,7 +2635,6 @@ static int zend_is_callable_check_class(const char *name, int name_len, zend_fca
}
/* }}} */
-
static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, int strict_class, char **error TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce_org = fcc->calling_scope;
@@ -2653,11 +2657,9 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
/* Skip leading \ */
if (Z_STRVAL_P(callable)[0] == '\\') {
mlen = Z_STRLEN_P(callable) - 1;
- mname = Z_STRVAL_P(callable) + 1;
lmname = zend_str_tolower_dup(Z_STRVAL_P(callable) + 1, mlen);
} else {
mlen = Z_STRLEN_P(callable);
- mname = Z_STRVAL_P(callable);
lmname = zend_str_tolower_dup(Z_STRVAL_P(callable), mlen);
}
/* Check if function with given name exists.