From b78ae363d44a4f2bb5ea35e6d6138c132cc9bcba Mon Sep 17 00:00:00 2001 From: BenoƮt Monin Date: Thu, 29 Aug 2013 22:14:59 +0200 Subject: type/default: fix 'undefined index' in rrd_gen_graph Fix php notices emitted when generating graphs of ping, sensors and hddtemp plugins. --- type/Default.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'type/Default.class.php') diff --git a/type/Default.class.php b/type/Default.class.php index e1b8835..57b505f 100644 --- a/type/Default.class.php +++ b/type/Default.class.php @@ -333,7 +333,7 @@ class Type_Default { $c = 0; foreach ($sources as $source) { - $dsname = $this->ds_names[$source] != '' ? $this->ds_names[$source] : $source; + $dsname = empty($this->ds_names[$source]) ? $source : $this->ds_names[$source]; $color = is_array($this->colors) ? (isset($this->colors[$source])?$this->colors[$source]:$this->colors[$c++]): $this->colors; $rrdgraph[] = sprintf('"LINE1:avg_%s#%s:%s"', crc32hex($source), $this->validate_color($color), $this->rrd_escape($dsname)); $rrdgraph[] = sprintf('"GPRINT:min_%s:MIN:%s Min,"', crc32hex($source), $this->rrd_format); -- cgit v1.1