Guest User

Untitled

a guest
Jul 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. Index: Zend/zend.c
  2. ===================================================================
  3. --- Zend/zend.c (revision 290872)
  4. +++ Zend/zend.c (working copy)
  5. @@ -1104,6 +1104,18 @@
  6. zend_error_cb(type, error_filename, error_lineno, format, args);
  7. }
  8. zval_ptr_dtor(&retval);
  9. +
  10. + /* allows monitoring type extensions to intercept calls even if
  11. + user has defined an error handler. */
  12. + if (EG(always_invoke_error_cb)) {
  13. + va_list orig_cb_copy;
  14. +
  15. + va_copy(orig_cb_copy, args);
  16. + zend_error_cb(type, error_filename, error_lineno, format, orig_cb_copy);
  17. +#ifdef va_copy
  18. + va_end(orig_cb_copy);
  19. +#endif
  20. + }
  21. }
  22. } else if (!EG(exception)) {
  23. /* The user error handler failed, use built-in error handler */
  24. Index: Zend/zend_globals.h
  25. ===================================================================
  26. --- Zend/zend_globals.h (revision 290872)
  27. +++ Zend/zend_globals.h (working copy)
  28. @@ -257,6 +257,8 @@
  29. void *saved_fpu_cw;
  30.  
  31. void *reserved[ZEND_MAX_RESERVED_RESOURCES];
  32. +
  33. + zend_bool always_invoke_error_cb;
  34. };
  35.  
  36. struct _zend_ini_scanner_globals {
  37. Index: Zend/zend_execute_API.c
  38. ===================================================================
  39. --- Zend/zend_execute_API.c (revision 290872)
  40. +++ Zend/zend_execute_API.c (working copy)
  41. @@ -150,6 +150,7 @@
  42. EG(in_autoload) = NULL;
  43. EG(autoload_func) = NULL;
  44. EG(error_handling) = EH_NORMAL;
  45. + EG(always_invoke_error_cb) = 0;
  46.  
  47. zend_vm_stack_init(TSRMLS_C);
  48. zend_vm_stack_push((void *) NULL TSRMLS_CC);
Add Comment
Please, Sign In to add comment