From 87e00b50607d03c6a9986478603dc56903d9f356 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Tue, 29 Sep 2009 20:10:16 +0200 Subject: prevent warning when no categories are defined --- index.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index cf0cb85..437093d 100644 --- a/index.php +++ b/index.php @@ -9,10 +9,12 @@ html_start(); $h = array(); # show all categorized hosts -foreach($CONFIG['cat'] as $cat => $hosts) { - printf("

%s

\n", $cat); - host_summary($hosts); - $h = array_merge($h, $hosts); +if (is_array($CONFIG['cat'])) { + foreach($CONFIG['cat'] as $cat => $hosts) { + printf("

%s

\n", $cat); + host_summary($hosts); + $h = array_merge($h, $hosts); + } } # search for uncategorized hosts -- cgit v1.1