From 042ce5512ec931a0a5cc92e9ca0ce38dca3631c7 Mon Sep 17 00:00:00 2001 From: jim-p Date: Sun, 15 Nov 2009 14:28:54 -0500 Subject: Style fixes to the previous commit. --- config/widget-snort/snort_alerts.inc.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'config/widget-snort') 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']) { -- cgit v1.2.3