Guest User

Untitled

a guest
Oct 22nd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. Index: main/main.c
  2. ===================================================================
  3. --- main/main.c (revision 312542)
  4. +++ main/main.c (working copy)
  5. @@ -906,6 +906,29 @@
  6. PG(last_error_lineno) = error_lineno;
  7. }
  8.  
  9. + /* change response status for fatal errors */
  10. + if (module_initialized) {
  11. + switch (type) {
  12. + case E_CORE_ERROR:
  13. + case E_ERROR:
  14. + case E_RECOVERABLE_ERROR:
  15. + case E_PARSE:
  16. + case E_COMPILE_ERROR:
  17. + case E_USER_ERROR:
  18. + if (!PG(display_errors) &&
  19. + !SG(headers_sent) &&
  20. + SG(sapi_headers).http_response_code == 200
  21. + ) {
  22. + sapi_header_line ctr = {0};
  23. +
  24. + ctr.line = "HTTP/1.0 500 Internal Server Error";
  25. + ctr.line_len = sizeof("HTTP/1.0 500 Internal Server Error") - 1;
  26. + sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
  27. + }
  28. + break;
  29. + }
  30. + }
  31. +
  32. /* according to error handling mode, suppress error, throw exception or show it */
  33. if (EG(error_handling) != EH_NORMAL) {
  34. switch (type) {
  35. @@ -1057,16 +1080,6 @@
  36. case E_USER_ERROR:
  37. EG(exit_status) = 255;
  38. if (module_initialized) {
  39. - if (!PG(display_errors) &&
  40. - !SG(headers_sent) &&
  41. - SG(sapi_headers).http_response_code == 200
  42. - ) {
  43. - sapi_header_line ctr = {0};
  44. -
  45. - ctr.line = "HTTP/1.0 500 Internal Server Error";
  46. - ctr.line_len = sizeof("HTTP/1.0 500 Internal Server Error") - 1;
  47. - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
  48. - }
  49. /* the parser would return 1 (failure), we can bail out nicely */
  50. if (type == E_PARSE) {
  51. CG(parse_error) = 0;
Add Comment
Please, Sign In to add comment