diff options
-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); |