mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
a7aaa93131
commit
18f02bf5b3
1 changed files with 2 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue