mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Merge pull request #5614 from cakephp/issue-5595
Convert header_sent exception into a notice error.
This commit is contained in:
commit
0a4141c78c
1 changed files with 3 additions and 4 deletions
|
@ -513,16 +513,15 @@ 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)) {
|
||||
throw new CakeException(
|
||||
__d('cake_dev', 'Headers already sent in %s on line %s', $filename, $linenum)
|
||||
);
|
||||
return;
|
||||
}
|
||||
if ($value === null) {
|
||||
header($name);
|
||||
|
|
Loading…
Add table
Reference in a new issue