aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/graph.php
diff options
context:
space:
mode:
authorPim van den Berg2014-05-24 11:30:46 +0200
committerPim van den Berg2014-05-24 11:34:16 +0200
commit216e492f32ab9a23e9b345e2bf424ba15025aec4 (patch)
tree0b41bdca550d355478d57722ceb458372ccbeed3 /graph.php
parentplugin: fix typo in temperature type (diff)
downloadapt-panopticon_cgp-216e492f32ab9a23e9b345e2bf424ba15025aec4.zip
apt-panopticon_cgp-216e492f32ab9a23e9b345e2bf424ba15025aec4.tar.gz
apt-panopticon_cgp-216e492f32ab9a23e9b345e2bf424ba15025aec4.tar.bz2
apt-panopticon_cgp-216e492f32ab9a23e9b345e2bf424ba15025aec4.tar.xz
graph.php: fix undefined index 'type' in $plugin_json[$type]
When type wasn't set in the plugin json, a "PHP Notice: Undefined index" would pop up. Just default to 'default' when type isn't set. Closes #76 #77
Diffstat (limited to 'graph.php')
-rw-r--r--graph.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/graph.php b/graph.php
index fbc93a7..55be9e9 100644
--- a/graph.php
+++ b/graph.php
@@ -35,6 +35,9 @@ if (file_exists('plugin/'.$plugin.'.json')) {
35 error_log('CGP Error: invalid json in plugin/'.$plugin.'.json'); 35 error_log('CGP Error: invalid json in plugin/'.$plugin.'.json');
36} 36}
37 37
38if (!isset($plugin_json[$type]['type']))
39 $plugin_json[$type]['type'] = 'default';
40
38switch ($plugin_json[$type]['type']) { 41switch ($plugin_json[$type]['type']) {
39 case 'stacked': 42 case 'stacked':
40 require_once 'type/GenericStacked.class.php'; 43 require_once 'type/GenericStacked.class.php';