The problem is that set_exception_handler allows you to reset the handler by
passing an empty string as argument. It did not check to make sure it was a
string before checking strlen, therefore when passed an array, it assumed
the user was resetting the handler. This patch only resets when an empty
string is passed in (an array will set a new handler).

Bob Silva

--- zend_builtin_functions.c     2004-10-11 23:04:15.000000000 -0700
+++ zend_builtin_functions.c  2004-10-11 23:08:10.000000000 -0700
@@ -1125,7 +1125,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_STRING && 
Z_STRLEN_PP(exception_handler)==0) { /* unset user-defined handler */
                FREE_ZVAL(EG(user_exception_handler));
                EG(user_exception_handler) = NULL;
                RETURN_TRUE;
-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to