Don't emit errors or trigger exceptions when headers have been sent.

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.
This commit is contained in:
mark_story 2015-01-09 15:16:14 -05:00
parent a7aaa93131
commit 18f02bf5b3

View file

@ -513,17 +513,14 @@ class CakeResponse {
/**
* Sends a header to the client.
*
* Will skip sending headers if headers have already been sent.
*
* @param string $name the header name
* @param string $value the header value
* @return void
* @throws CakeException When headers have already been sent
*/
protected function _sendHeader($name, $value = null) {
if (headers_sent($filename, $linenum)) {
trigger_error(
__d('cake_dev', 'Headers already sent in %s on line %s', $filename, $linenum),
E_USER_NOTICE
);
return;
}
if ($value === null) {