Preventing possible errors caused by sending headers when testing on cli

This commit is contained in:
Jose Lorenzo Rodriguez 2011-04-22 09:03:55 -04:30
parent d8933fb773
commit 8ff0330789

View file

@ -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}");
}
} }
} }