diff options
-rw-r--r-- | it.class | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -225,6 +225,9 @@ static function error($p = array()) } } + if ($p['fatal'] && $_SERVER['REMOTE_ADDR'] && !headers_sent()) + http_response_code(500); + if ($toscreen || $sendmail) { $p['body'] = is_string($p['body']) || !array_key_exists('body', $p) ? $p['body'] : var_export($p['body'], true); @@ -264,7 +267,7 @@ static function error($p = array()) $body = it::replace(array('(pw|passw|password|secret)(\' => |\] => |=)[^&\s]*' => '$1$2********'), $body, array('utf8' => false)); } - it::mail(array('To' => $p['to'], 'Subject' => "Alert: " . substr($p['title'], 0, 160), 'Body' => $body, 'Cc' => $GLOBALS['it_defaultconfig']['error_cc'], 'forcemail' => !it::is_devel())); + it::mail(array('To' => $p['to'], 'Subject' => ($p['fatal'] ? "Fatal: " : "Error: ") . substr($p['title'], 0, 160), 'Body' => $body, 'Cc' => $GLOBALS['it_defaultconfig']['error_cc'], 'forcemail' => !it::is_devel())); $p['title'] = "Mail: " . $p['title']; } else if ($_SERVER['REMOTE_ADDR']) # toscreen mode: web @@ -280,11 +283,7 @@ static function error($p = array()) @chmod("/tmp/alertdata/alert.log", 0777); if ($p['fatal']) - { - if ($_SERVER['REMOTE_ADDR'] && !headers_sent()) - header("HTTP/1.0 500 Internal Server Error"); exit(99); - } return null; } |