diff options
author | Pim van den Berg | 2014-05-03 09:51:41 +0200 |
---|---|---|
committer | Pim van den Berg | 2014-05-03 10:11:07 +0200 |
commit | d72e04ce95bfcbdca9bed70bf3eb5943463d6a86 (patch) | |
tree | 6215edd6bbba35f49a27472a8fb306229581b614 /detail.php | |
parent | plugin/memory: add osx/bsd ds_names to order, set color of active to ff00ff (diff) | |
download | apt-panopticon_cgp-d72e04ce95bfcbdca9bed70bf3eb5943463d6a86.zip apt-panopticon_cgp-d72e04ce95bfcbdca9bed70bf3eb5943463d6a86.tar.gz apt-panopticon_cgp-d72e04ce95bfcbdca9bed70bf3eb5943463d6a86.tar.bz2 apt-panopticon_cgp-d72e04ce95bfcbdca9bed70bf3eb5943463d6a86.tar.xz |
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
Diffstat (limited to '')
-rw-r--r-- | detail.php | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -30,9 +30,7 @@ html_start(); | |||
30 | printf('<fieldset id="%s">', $host); | 30 | printf('<fieldset id="%s">', $host); |
31 | printf('<legend>%s</legend>', $host); | 31 | printf('<legend>%s</legend>', $host); |
32 | 32 | ||
33 | $plugins = collectd_plugins($host); | 33 | if (!$plugins = collectd_plugins($host)) { |
34 | |||
35 | if(!$plugins) { | ||
36 | echo "Unknown host\n"; | 34 | echo "Unknown host\n"; |
37 | return false; | 35 | return false; |
38 | } | 36 | } |