summaryrefslogtreecommitdiff
path: root/Zend/zend_builtin_functions.c
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2002-09-16 01:36:48 +0000
committerAndrei Zmievski <andrei@php.net>2002-09-16 01:36:48 +0000
commita35c61af3c0c48b86385ee579be2dca1d2b41494 (patch)
treef28d85a02d563be45ba23446df972580f8e73f62 /Zend/zend_builtin_functions.c
parent78a17be5e59cf15a93fd960a8936e5dbff1155e1 (diff)
downloadphp-git-a35c61af3c0c48b86385ee579be2dca1d2b41494.tar.gz
MFZE1
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r--Zend/zend_builtin_functions.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 22afc71625..fdc9c49f9b 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -803,8 +803,9 @@ ZEND_FUNCTION(class_exists)
ZEND_FUNCTION(function_exists)
{
zval **function_name;
+ zend_function *func;
char *lcname;
- int retval;
+ zend_bool retval;
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &function_name)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
@@ -813,9 +814,18 @@ ZEND_FUNCTION(function_exists)
lcname = estrndup((*function_name)->value.str.val, (*function_name)->value.str.len);
zend_str_tolower(lcname, (*function_name)->value.str.len);
- retval = zend_hash_exists(EG(function_table), lcname, (*function_name)->value.str.len+1);
+ retval = (zend_hash_find(EG(function_table), lcname, (*function_name)->value.str.len+1, (void **)&func) == SUCCESS);
efree(lcname);
+ /*
+ * A bit of a hack, but not a bad one: we see if the handler of the function
+ * is actually one that displays "function is disabled" message.
+ */
+ if (retval &&
+ func->internal_function.handler == zif_display_disabled_function) {
+ retval = 0;
+ }
+
RETURN_BOOL(retval);
}
/* }}} */