]> granicus.if.org Git - php/commitdiff
Fix set_error_handler()
authorZeev Suraski <zeev@php.net>
Sun, 8 Jun 2003 14:00:11 +0000 (14:00 +0000)
committerZeev Suraski <zeev@php.net>
Sun, 8 Jun 2003 14:00:11 +0000 (14:00 +0000)
Zend/zend_builtin_functions.c

index 4cc1fec25900aaaee61673126af273d46a697446..2d707e5fea253c3c30c62635415ca6348f250eec 100644 (file)
@@ -964,17 +964,11 @@ ZEND_FUNCTION(set_error_handler)
        }
        ALLOC_ZVAL(EG(user_error_handler));
 
-#ifdef JANI_0
-    /*
-     * This part would never be reached unless there is something
-     * wrong with the engine as empty string can not be valid call back.
-     * See bug #23619 for more information why this is left here.
-     * (this only applies to non-debug-builds.)
-     */
-    if (Z_STRLEN_PP(error_handler)==0) { /* unset user-defined handler */
-        zend_error(E_ERROR, "%s(): This should never happen! '%s'", get_active_function_name(TSRMLS_C), error_handler);
-    }
-#endif
+    if (!zend_is_true(*error_handler)) { /* unset user-defined handler */
+               FREE_ZVAL(EG(user_error_handler));
+               EG(user_error_handler) = NULL;
+               RETURN_TRUE;
+       }
 
        *EG(user_error_handler) = **error_handler;
        zval_copy_ctor(EG(user_error_handler));