diff options
author | NewEraCracker <neweracracker@gmail.com> | 2016-01-18 08:49:06 +0000 |
---|---|---|
committer | NewEraCracker <neweracracker@gmail.com> | 2016-01-18 08:49:06 +0000 |
commit | 27e1e9d51e0db308b3eede5200f615f24aed53f1 (patch) | |
tree | 672c53221aab44ef1ede746dd701cf9a608b8832 /src/usr/local | |
parent | eca491c30678083bcd7f11098d127cfe244484ad (diff) | |
download | pfsense-27e1e9d51e0db308b3eede5200f615f24aed53f1.zip pfsense-27e1e9d51e0db308b3eede5200f615f24aed53f1.tar.gz |
Minor corrections to guiconfig.inc
Set logarr as array() per default, default invert to empty string, improve variable representation within strings
Diffstat (limited to 'src/usr/local')
-rw-r--r-- | src/usr/local/www/guiconfig.inc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc index d09213b..b97ae0f 100644 --- a/src/usr/local/www/guiconfig.inc +++ b/src/usr/local/www/guiconfig.inc @@ -560,20 +560,21 @@ function dump_clog_no_table($logfile, $tail, $withorig = true, $grepfor = "", $g $specific_log = basename($logfile, '.log') . '_settings'; if ($config['syslog'][$specific_log]['cronorder'] == 'forward') $sor = ""; if ($config['syslog'][$specific_log]['cronorder'] == 'reverse') $sor = "-r"; - $logarr = ""; + $logarr = array(); $grepline = " "; if (is_array($grepfor)) { + $invert = ''; if ((strpos($grepfor[0], '!') === 0)) { $grepfor[0] = substr($grepfor[0], 1); $invert = '-v'; } - $grepline .= " | /usr/bin/egrep $invert " . escapeshellarg(implode("|", $grepfor)); + $grepline .= " | /usr/bin/egrep {$invert} " . escapeshellarg(implode("|", $grepfor)); } if (is_array($grepinvert)) { $grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert)); } if (is_dir($logfile)) { - $logarr = array("File $logfile is a directory."); + $logarr = array("File {$logfile} is a directory."); } elseif (file_exists($logfile) && filesize($logfile) == 0) { $logarr = array("Log file started."); } else { @@ -610,20 +611,21 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert $specific_log = basename($logfile, '.log') . '_settings'; if ($config['syslog'][$specific_log]['cronorder'] == 'forward') $sor = ""; if ($config['syslog'][$specific_log]['cronorder'] == 'reverse') $sor = "-r"; - $logarr = ""; + $logarr = array(); $grepline = " "; if (is_array($grepfor)) { + $invert = ''; if ((strpos($grepfor[0], '!') === 0)) { $grepfor[0] = substr($grepfor[0], 1); $invert = '-v'; } - $grepline .= " | /usr/bin/egrep $invert " . escapeshellarg(implode("|", $grepfor)); + $grepline .= " | /usr/bin/egrep {$invert} " . escapeshellarg(implode("|", $grepfor)); } if (is_array($grepinvert)) { $grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert)); } if (is_dir($logfile)) { - $logarr = array("File $logfile is a directory."); + $logarr = array("File {$logfile} is a directory."); } elseif (file_exists($logfile) && filesize($logfile) == 0) { $logarr = array("Log file started."); } else { @@ -659,7 +661,7 @@ function return_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinve $specific_log = basename($logfile, '.log') . '_settings'; if (($config['syslog'][$specific_log]['cronorder'] == 'forward') && !$grepreverse) $sor = ""; if (($config['syslog'][$specific_log]['cronorder'] == 'reverse') || $grepreverse) $sor = "-r"; - $logarr = ""; + $logarr = array(); $grepline = " "; if (is_array($grepfor)) { $grepline .= " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor)); |