From a4b5c28356ea0b9cbe31ff8186d63407111dcf0c Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Wed, 6 Dec 2017 02:26:32 -0600 Subject: [PATCH] Fix web validation shows Array (#7860) fixes: #7851 --- LibreNMS/ValidationResult.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/LibreNMS/ValidationResult.php b/LibreNMS/ValidationResult.php index 01392a3219..7dfe96bf8f 100644 --- a/LibreNMS/ValidationResult.php +++ b/LibreNMS/ValidationResult.php @@ -111,6 +111,12 @@ class ValidationResult public function setList($description, array $list) { + if (is_array(current($list))) { + $list = array_map(function ($item) { + return implode(' ', $item); + }, $list); + } + $this->list_description = $description; $this->list = $list; return $this; @@ -180,12 +186,6 @@ class ValidationResult */ private function printList($format = "\t %s\n", $max = 15) { - if (is_array(current($this->list))) { - $this->list = array_map(function ($item) { - return implode(' ', $item); - }, $this->list); - } - foreach (array_slice($this->list, 0, $max) as $item) { printf($format, $item); }