mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +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,12 +363,14 @@ class CakeResponse {
|
|||
* @return void
|
||||
*/
|
||||
protected function _sendHeader($name, $value = null) {
|
||||
if (!headers_sent()) {
|
||||
if (is_null($value)) {
|
||||
header($name);
|
||||
} else {
|
||||
header("{$name}: {$value}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a content string to the client.
|
||||
|
|
Loading…
Reference in a new issue