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 --- detail.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'detail.php') diff --git a/detail.php b/detail.php index 4eacc80..33db2b9 100644 --- a/detail.php +++ b/detail.php @@ -30,9 +30,7 @@ html_start(); 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