mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Preventing possible errors caused by sending headers when testing on cli
This commit is contained in:
parent
d8933fb773
commit
8ff0330789
1 changed files with 6 additions and 4 deletions
|
@ -363,10 +363,12 @@ class CakeResponse {
|
|||
* @return void
|
||||
*/
|
||||
protected function _sendHeader($name, $value = null) {
|
||||
if (is_null($value)) {
|
||||
header($name);
|
||||
} else {
|
||||
header("{$name}: {$value}");
|
||||
if (!headers_sent()) {
|
||||
if (is_null($value)) {
|
||||
header($name);
|
||||
} else {
|
||||
header("{$name}: {$value}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue