From 2c6efc978d2fc988ff8fafbf59bcdc6050a3695d Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 30 Jan 2014 16:11:33 -0500 Subject: Allow for multiple filter terms in mailreport --- config/mailreport/mail_reports.inc | 3 +-- config/mailreport/mailreport.xml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'config/mailreport') diff --git a/config/mailreport/mail_reports.inc b/config/mailreport/mail_reports.inc index cf8c837c..94c7500c 100644 --- a/config/mailreport/mail_reports.inc +++ b/config/mailreport/mail_reports.inc @@ -1232,8 +1232,7 @@ function mail_report_get_log($logfile, $tail, $grepfor) { $logarr = ""; $grepline = " "; if(is_array($grepfor)) - foreach($grepfor as $agrep) - $grepline .= " | grep \"$agrep\""; + $grepline = " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor)); if($config['system']['disablesyslogclog']) { exec("cat {$logfile}{$grepline} | /usr/bin/tail -n {$tail}", $logarr); } else { diff --git a/config/mailreport/mailreport.xml b/config/mailreport/mailreport.xml index 3b926753..4d392fd9 100644 --- a/config/mailreport/mailreport.xml +++ b/config/mailreport/mailreport.xml @@ -37,7 +37,7 @@ ]]> mailreport - 2.0.7 + 2.0.8 Status: Mail Reports /usr/local/bin/ -- cgit v1.2.3