From b109234dfa087b162f712ee305f231bfe4b5bf41 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 20 Mar 2020 22:50:18 +0100 Subject: [PATCH] Unbound: minor cleanup in /api/unbound/diagnostics/stats endpoint --- .../OPNsense/Unbound/Api/DiagnosticsController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Unbound/Api/DiagnosticsController.php b/src/opnsense/mvc/app/controllers/OPNsense/Unbound/Api/DiagnosticsController.php index 5de7fbcd3..294c3c6e1 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Unbound/Api/DiagnosticsController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Unbound/Api/DiagnosticsController.php @@ -46,10 +46,10 @@ class DiagnosticsController extends ApiControllerBase { $ret['status'] = "failed"; $backend = new Backend(); - $result = trim($backend->configdRun('unbound stats')); - if ($result != "null") { + $result = json_decode($backend->configdRun('unbound stats'), true); + if ($result != null) { $ret['status'] = "ok"; - $ret['data'] = json_decode($result); + $ret['data'] = $result; } return $ret; }