mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +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.
|
* Sends a header to the client.
|
||||||
*
|
*
|
||||||
|
* Will skip sending headers if headers have already been sent.
|
||||||
|
*
|
||||||
* @param string $name the header name
|
* @param string $name the header name
|
||||||
* @param string $value the header value
|
* @param string $value the header value
|
||||||
* @return void
|
* @return void
|
||||||
* @throws CakeException When headers have already been sent
|
|
||||||
*/
|
*/
|
||||||
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(
|
return;
|
||||||
__d('cake_dev', 'Headers already sent in %s on line %s', $filename, $linenum)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if ($value === null) {
|
if ($value === null) {
|
||||||
header($name);
|
header($name);
|
||||||
|
|
Loading…
Add table
Reference in a new issue