Skip to content

Commit

Permalink
Preventing possible errors caused by sending headers when testing on cli
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Apr 22, 2011
1 parent d8933fb commit 8ff0330
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/Cake/Network/CakeResponse.php
Expand Up @@ -363,10 +363,12 @@ public function send() {
* @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}");
}
}
}

Expand Down

0 comments on commit 8ff0330

Please sign in to comment.