cvs: ZendEngine2(PHP_5_0) / zend_builtin_functions.c
| From: | Marcus Boerger | Date: | Tue, 12 Oct 2004 09:14:55 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_0) / zend_builtin_functions.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3090@lists.php.net to get a copy of this message | ||
helly Tue Oct 12 05:14:55 2004 EDT
Modified files: (Branch: PHP_5_0)
/ZendEngine2 zend_builtin_functions.c
Log:
-MFH Fix set_exception_handler()
http://cvs.php.net/diff.php/ZendEngine2/zend_builtin_functions.c?r1=1.239.2.7&r2=1.239.2.8&ty=u
Index: ZendEngine2/zend_builtin_functions.c
diff -u ZendEngine2/zend_builtin_functions.c:1.239.2.7
ZendEngine2/zend_builtin_functions.c:1.239.2.8
--- ZendEngine2/zend_builtin_functions.c:1.239.2.7 Mon Oct 4 05:03:10 2004
+++ ZendEngine2/zend_builtin_functions.c Tue Oct 12 05:14:55 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_builtin_functions.c,v 1.239.2.7 2004/10/04 09:03:10 helly Exp $ */
+/* $Id: zend_builtin_functions.c,v 1.239.2.8 2004/10/12 09:14:55 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -1109,13 +1109,15 @@
ZEND_WRONG_PARAM_COUNT();
}
- if (!zend_is_callable(*exception_handler, 0, &exception_handler_name)) {
- zend_error(E_WARNING, "%s() expects the argument (%s) to be a valid callback",
- get_active_function_name(TSRMLS_C),
exception_handler_name?exception_handler_name:"unknown");
+ if (Z_TYPE_PP(exception_handler) != IS_NULL) { /* NULL == unset */
+ if (!zend_is_callable(*exception_handler, 0, &exception_handler_name)) {
+ zend_error(E_WARNING, "%s() expects the argument (%s) to be a valid callback",
+ get_active_function_name(TSRMLS_C),
exception_handler_name?exception_handler_name:"unknown");
+ efree(exception_handler_name);
+ return;
+ }
efree(exception_handler_name);
- return;
}
- efree(exception_handler_name);
if (EG(user_exception_handler)) {
had_orig_exception_handler = 1;
@@ -1125,7 +1127,7 @@
}
ALLOC_ZVAL(EG(user_exception_handler));
- if (Z_STRLEN_PP(exception_handler)==0) { /* unset user-defined handler */
+ if (Z_TYPE_PP(exception_handler) == IS_NULL) { /* unset user-defined handler */
FREE_ZVAL(EG(user_exception_handler));
EG(user_exception_handler) = NULL;
RETURN_TRUE;