diff options
author | Pim van den Berg | 2013-02-09 22:42:01 +0100 |
---|---|---|
committer | Pim van den Berg | 2013-02-09 22:42:01 +0100 |
commit | e5513d2a3df9ea13693a4ed10b4b57bb232a6178 (patch) | |
tree | cb0279466e751133695c144c1b19271f6c72939b /inc/collectd.inc.php | |
parent | remove arguments overview_plugins and other_plugins from plugins_list function (diff) | |
download | apt-panopticon_cgp-e5513d2a3df9ea13693a4ed10b4b57bb232a6178.zip apt-panopticon_cgp-e5513d2a3df9ea13693a4ed10b4b57bb232a6178.tar.gz apt-panopticon_cgp-e5513d2a3df9ea13693a4ed10b4b57bb232a6178.tar.bz2 apt-panopticon_cgp-e5513d2a3df9ea13693a4ed10b4b57bb232a6178.tar.xz |
inc/collectd.inc.php: remove . and .. from scandir before foreach
Reported-by: Reza (http://pommi.nethuis.nl/collectd-graph-panel-v0-3/#comment-26990)
Diffstat (limited to '')
-rw-r--r-- | inc/collectd.inc.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php index 99ffdd1..56c5a2d 100644 --- a/inc/collectd.inc.php +++ b/inc/collectd.inc.php | |||
@@ -11,9 +11,9 @@ function collectd_hosts() { | |||
11 | if (!is_dir($CONFIG['datadir'])) | 11 | if (!is_dir($CONFIG['datadir'])) |
12 | return false; | 12 | return false; |
13 | 13 | ||
14 | $dir = scandir($CONFIG['datadir']); | 14 | $dir = array_diff(scandir($CONFIG['datadir']), array('.', '..')); |
15 | foreach($dir as $k => $v) { | 15 | foreach($dir as $k => $v) { |
16 | if(!is_dir($CONFIG['datadir'].'/'.$v) || $v == '.' || $v == '..') | 16 | if(!is_dir($CONFIG['datadir'].'/'.$v)) |
17 | unset($dir[$k]); | 17 | unset($dir[$k]); |
18 | } | 18 | } |
19 | return($dir); | 19 | return($dir); |