Skip to content

Commit

Permalink
Fix web validation shows Array (librenms#7860)
Browse files Browse the repository at this point in the history
  • Loading branch information
murrant authored and laf committed Dec 6, 2017
1 parent 38bde97 commit a4b5c28
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions LibreNMS/ValidationResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ public function getList()

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;
Expand Down Expand Up @@ -180,12 +186,6 @@ public function getListDescription()
*/
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);
}
Expand Down

0 comments on commit a4b5c28

Please sign in to comment.