From 216e492f32ab9a23e9b345e2bf424ba15025aec4 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 24 May 2014 11:30:46 +0200 Subject: 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 --- graph.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'graph.php') 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')) { error_log('CGP Error: invalid json in plugin/'.$plugin.'.json'); } +if (!isset($plugin_json[$type]['type'])) + $plugin_json[$type]['type'] = 'default'; + switch ($plugin_json[$type]['type']) { case 'stacked': require_once 'type/GenericStacked.class.php'; -- cgit v1.1