From 056714a29721f1332f2497e440654f6735055d67 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 28 Jun 2014 16:10:02 +0200 Subject: type/base: replace array_merge by + sign to merge a fallback array array_merge resets the index, while in case of $this->colors and $this->legend, we'd like to keep the index. An irq plugin sample: array(1 => 1, 'ERR' => 'ERR') must not become array(0 => 1, 'ERR' => 'ERR') after an array_merge. --- type/Base.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/type/Base.class.php b/type/Base.class.php index 883c98f..34e182f 100644 --- a/type/Base.class.php +++ b/type/Base.class.php @@ -191,7 +191,7 @@ class Type_Base { $colors = $this->colors; $this->rainbow_colors(); - $this->colors = array_merge($this->colors, $colors); + $this->colors = $colors + $this->colors; $graphdata = $this->rrd_gen_graph(); @@ -304,7 +304,7 @@ class Type_Base { function parse_legend($sources) { # fill up legend by items that are not defined by plugin - $this->legend = array_merge(array_combine($sources, $sources), $this->legend); + $this->legend = $this->legend + array_combine($sources, $sources); # detect length of longest legend $max = 0; -- cgit v1.1