Permalink
Browse files

User error handlers no longer catch supressed errors (patch by Etienn…

…e Kneuss)
  • Loading branch information...
1 parent 2801e87 commit fd0d44f0a78bf528cc780b1fd5036e390de19a22 @felipensp felipensp committed Mar 8, 2008
Showing with 12 additions and 1 deletion.
  1. +2 −1 Zend/zend.c
  2. +6 −0 Zend/zend.h
  3. +4 −0 Zend/zend_globals.h
View
3 Zend/zend.c
@@ -1006,7 +1006,8 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
/* if we don't have a user defined error handler */
if (!EG(user_error_handler)
- || !(EG(user_error_handler_error_reporting) & type)) {
+ || !(EG(user_error_handler_error_reporting) & type)
+ || EG(error_handling) != EH_NORMAL) {
zend_error_cb(type, error_filename, error_lineno, format, args);
} else switch (type) {
case E_ERROR:
View
6 Zend/zend.h
@@ -715,6 +715,12 @@ END_EXTERN_C()
#include "zend_operators.h"
#include "zend_variables.h"
+typedef enum {
+ EH_NORMAL = 0,
+ EH_SUPPRESS,
+ EH_THROW
+} zend_error_handling_t;
+
#endif /* ZEND_H */
/*
View
4 Zend/zend_globals.h
@@ -218,11 +218,15 @@ struct _zend_executor_globals {
int user_error_handler_error_reporting;
zval *user_error_handler;
+ zval *user_error_handler_old;
zval *user_exception_handler;
zend_stack user_error_handlers_error_reporting;
zend_ptr_stack user_error_handlers;
zend_ptr_stack user_exception_handlers;
+ zend_error_handling_t error_handling;
+ zend_class_entry *exception_class;
+
/* timeout support */
int timeout_seconds;

0 comments on commit fd0d44f

Please sign in to comment.