replace whitespaces with TABs and only throw exception when Cake is in Debug mode

This commit is contained in:
Xinquan Zhu 2014-07-18 11:50:45 +09:00 committed by mark_story
parent 792c251890
commit 809de69dcf

View file

@ -519,14 +519,16 @@ class CakeResponse {
* @return void
*/
protected function _sendHeader($name, $value = null) {
if (!headers_sent($filename, $linenum)) {
if (!headers_sent($filename, $linenum)) {
if ($value === null) {
header($name);
} else {
header("{$name}: {$value}");
}
} else {
throw new Exception("Headers already sent in $filename on line $linenum\n");
} else {
if (Configure::read('debug')) {
throw new Exception(__d('cake_dev', 'Headers already sent in $filename on line $linenum'));
}
}
}