mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Convert header_sent exception into a notice error.
Throwing an exception here, causes an infinite loop when handling fatal errors, as the shutdown function sends headers automatically. Refs #5595
This commit is contained in:
parent
2ee5c3d73d
commit
a7aaa93131
1 changed files with 4 additions and 2 deletions
|
@ -520,9 +520,11 @@ class CakeResponse {
|
||||||
*/
|
*/
|
||||||
protected function _sendHeader($name, $value = null) {
|
protected function _sendHeader($name, $value = null) {
|
||||||
if (headers_sent($filename, $linenum)) {
|
if (headers_sent($filename, $linenum)) {
|
||||||
throw new CakeException(
|
trigger_error(
|
||||||
__d('cake_dev', 'Headers already sent in %s on line %s', $filename, $linenum)
|
__d('cake_dev', 'Headers already sent in %s on line %s', $filename, $linenum),
|
||||||
|
E_USER_NOTICE
|
||||||
);
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if ($value === null) {
|
if ($value === null) {
|
||||||
header($name);
|
header($name);
|
||||||
|
|
Loading…
Reference in a new issue