From 7206b74c18aa8a1790748cb3fe5f0845ac54f44e Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Sun, 15 Feb 2009 21:58:34 -0600 Subject: hopefully fix logging from old versions --- config/imspector/services_imspector_logs.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'config/imspector') diff --git a/config/imspector/services_imspector_logs.php b/config/imspector/services_imspector_logs.php index 6da86d47..26ebd97a 100644 --- a/config/imspector/services_imspector_logs.php +++ b/config/imspector/services_imspector_logs.php @@ -101,15 +101,21 @@ if ($_POST['mode'] == "render") { while (!feof($fd)) { $line = fgets($fd); if(feof($fd)) continue; - - preg_match('/([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),(|.*),(.*)/', $line, $matches); + $new_format = '([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*)'; + $old_format = '([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*)'; + preg_match("/${new_format}|${old_format}/", $line, $matches); $address = $matches[1]; $timestamp = $matches[2]; $direction = $matches[3]; $type = $matches[4]; $filtered = $matches[5]; - $category = $matches[6]; - $data = $matches[7]; + if(count($matches) == 8) { + $category = $matches[6]; + $data = $matches[7]; + } else { + $category = ""; + $data = $matches[6]; + } if($direction == '0') { $bgcolor = $convo_remote_bgcolor; -- cgit v1.2.3