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,10 +363,12 @@ class CakeResponse {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _sendHeader($name, $value = null) {
|
protected function _sendHeader($name, $value = null) {
|
||||||
if (is_null($value)) {
|
if (!headers_sent()) {
|
||||||
header($name);
|
if (is_null($value)) {
|
||||||
} else {
|
header($name);
|
||||||
header("{$name}: {$value}");
|
} else {
|
||||||
|
header("{$name}: {$value}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue