diff options
author | jim-p <jim@pingle.org> | 2009-11-15 14:28:54 -0500 |
---|---|---|
committer | jim-p <jim@pingle.org> | 2009-11-15 14:28:54 -0500 |
commit | 042ce5512ec931a0a5cc92e9ca0ce38dca3631c7 (patch) | |
tree | 0a71c75d867766e09ef52a4f488c8690a2a03299 /config/widget-snort | |
parent | 2e52447a3947bc5bc735ba55d94c550ed2efa5b4 (diff) | |
download | pfsense-packages-042ce5512ec931a0a5cc92e9ca0ce38dca3631c7.tar.gz pfsense-packages-042ce5512ec931a0a5cc92e9ca0ce38dca3631c7.tar.bz2 pfsense-packages-042ce5512ec931a0a5cc92e9ca0ce38dca3631c7.zip |
Style fixes to the previous commit.
Diffstat (limited to 'config/widget-snort')
-rw-r--r-- | config/widget-snort/snort_alerts.inc.php | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/config/widget-snort/snort_alerts.inc.php b/config/widget-snort/snort_alerts.inc.php index af3b79ea..b56ac02c 100644 --- a/config/widget-snort/snort_alerts.inc.php +++ b/config/widget-snort/snort_alerts.inc.php @@ -40,19 +40,18 @@ function parse_snort_alert_line($line) { $usableline = false; if($usableline == true) { - preg_match("/^(\d+)\/(\d+)-(\d+\:\d+\:\d+).\d+$/U", $alert['time'], $datesplit); - $now_time = strtotime("now"); - $checkdate = $datesplit[1] . "/" . $datesplit[2] . "/" . date("Y"); - $fulldate = $datesplit[2] . "/" . $datesplit[1] . "/" . date("Y"); - $logdate = $checkdate . " " . $datesplit[3]; - if ($now_time < strtotime($logdate) ) - { - $fulldate = $datesplit[2] . "/" . $datesplit[1] . "/" . ((int)date("Y") - 1); - } + preg_match("/^(\d+)\/(\d+)-(\d+\:\d+\:\d+).\d+$/U", $alert['time'], $datesplit); + $now_time = strtotime("now"); + $checkdate = $datesplit[1] . "/" . $datesplit[2] . "/" . date("Y"); + $fulldate = $datesplit[2] . "/" . $datesplit[1] . "/" . date("Y"); + $logdate = $checkdate . " " . $datesplit[3]; + if ($now_time < strtotime($logdate)) { + $fulldate = $datesplit[2] . "/" . $datesplit[1] . "/" . ((int)date("Y") - 1); + } - $alert['dateonly'] = $fulldate; - $alert['timeonly'] = $datesplit[3]; - $alert['category'] = strtoupper( substr($alert["category"],0 , 1) ) . strtolower( substr($alert["category"],1 ) ); + $alert['dateonly'] = $fulldate; + $alert['timeonly'] = $datesplit[3]; + $alert['category'] = strtoupper( substr($alert["category"],0 , 1) ) . strtolower( substr($alert["category"],1 ) ); return $alert; } else { if($g['debug']) { |