From cde0308016fdc195310c0925d9062f3aa99f9ab3 Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Wed, 29 Apr 2009 16:46:34 +0200 Subject: [PATCH] Fixed a bug detection syslog facily, severity and messagetype fields on index site. This could cause these fields to be represented numeric instead of huma readable. --- src/index.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.php b/src/index.php index ff91ad1..6040fe3 100644 --- a/src/index.php +++ b/src/index.php @@ -382,7 +382,8 @@ if ( isset($content['Sources'][$currentSourceID]) ) // Special style classes and colours for SYSLOG_FACILITY if ( $mycolkey == SYSLOG_FACILITY ) { - if ( isset($logArray[$mycolkey][SYSLOG_FACILITY]) && strlen($logArray[$mycolkey][SYSLOG_FACILITY]) > 0) +// if ( isset($logArray[$mycolkey][SYSLOG_FACILITY]) && strlen($logArray[$mycolkey][SYSLOG_FACILITY]) > 0) + if ( isset($logArray[$mycolkey]) && is_numeric($logArray[$mycolkey]) ) { $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = 'bgcolor="' . $facility_colors[ $logArray[SYSLOG_FACILITY] ] . '" '; $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldcssclass'] = "lineColouredBlack"; @@ -401,7 +402,8 @@ if ( isset($content['Sources'][$currentSourceID]) ) } else if ( $mycolkey == SYSLOG_SEVERITY ) { - if ( isset($logArray[$mycolkey][SYSLOG_SEVERITY]) && strlen($logArray[$mycolkey][SYSLOG_SEVERITY]) > 0) +// if ( isset($logArray[$mycolkey][SYSLOG_SEVERITY]) && strlen($logArray[$mycolkey][SYSLOG_SEVERITY]) > 0) + if ( isset($logArray[$mycolkey]) && is_numeric($logArray[$mycolkey]) ) { $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = 'bgcolor="' . $severity_colors[ $logArray[SYSLOG_SEVERITY] ] . '" '; $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldcssclass'] = "lineColouredWhite"; @@ -420,7 +422,8 @@ if ( isset($content['Sources'][$currentSourceID]) ) } else if ( $mycolkey == SYSLOG_MESSAGETYPE ) { - if ( isset($logArray[$mycolkey][SYSLOG_MESSAGETYPE]) ) +// if ( isset($logArray[$mycolkey][SYSLOG_MESSAGETYPE]) ) + if ( isset($logArray[$mycolkey]) && is_numeric($logArray[$mycolkey]) ) { $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = 'bgcolor="' . $msgtype_colors[ $logArray[SYSLOG_MESSAGETYPE] ] . '" '; $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldcssclass'] = "lineColouredBlack";