From d72e04ce95bfcbdca9bed70bf3eb5943463d6a86 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 3 May 2014 09:51:41 +0200 Subject: inc/collectd: consistently return false instead of an empty array or false This means we have to check the return value of these functions for example before doing a foreach. We can't just do a foreach and assume the return value of a function is an array, while it can be false and results in a PHP warning. Closes: https://github.com/pommi/CGP/pull/68 --- host.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'host.php') diff --git a/host.php b/host.php index cc6fa50..b398630 100644 --- a/host.php +++ b/host.php @@ -15,9 +15,7 @@ printf("
", $host); printf("%s", $host); -$plugins = collectd_plugins($host); - -if(!$plugins) { +if (!$plugins = collectd_plugins($host)) { echo "Unknown host\n"; return false; } -- cgit v1.1