Convert header_sent exception into a notice error.#5614
Conversation
Throwing an exception here, causes an infinite loop when handling fatal errors, as the shutdown function sends headers automatically. Refs #5595
|
While this does solve the infinite loop problem, fatal error pages in development mode will still show multiple notice errors as the error response page contains 3 headers that cannot be sent. |
I guess we can live with that. |
|
The alternatives I could come up with included:
|
|
I am in favor of alternative # 1 :) |
|
👍 to alternative 1 |
|
We could also add a config value for it :) Not having that (useful) warning at all will be most unfortunate for the majority of 2.x users. |
|
Has anyone else got a blank page due to headers being already sent as stated in the original issue #3990? If you try to redirect after headers (output) already being sent PHP itself would show an error. |
After discussing it a bit, we've come to consensus that emitting errors or throwing exceptions are both pretty disruptive and annoying to deal with. Instead we'll revert to the previous 2.x behavior of doing nothing.
|
Changed up. |
Convert header_sent exception into a notice error.
|
I could go either way (no errors at all or a config var to disable this all together like @dereuromark suggested. I actually thought of that myself earlier, and didn't suggest it, but glad he did now. I'm working on cleaning up my 2.x code, but it will take several months. It's not changing the code, but testing it afterwards that takes a long time. |
Throwing an exception here, causes an infinite loop when handling fatal errors, as the shutdown function sends headers automatically.
Refs #5595