From 5101cad69066bb4ef061afd155504f89a077ce75 Mon Sep 17 00:00:00 2001 From: Mark Unwin Date: Tue, 19 Mar 2024 13:41:49 +1000 Subject: [PATCH] Populate ip_padded in discovery log for discoveriesRead template. --- app/Models/DiscoveriesModel.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/DiscoveriesModel.php b/app/Models/DiscoveriesModel.php index 3df5591fa..ab62f02d8 100644 --- a/app/Models/DiscoveriesModel.php +++ b/app/Models/DiscoveriesModel.php @@ -550,7 +550,11 @@ public function includedRead(int $id = 0): array $sql = "SELECT * FROM discovery_log WHERE discovery_id = ? ORDER BY id"; $query = $this->db->query($sql, [$id]); - $included['discovery_log'] = $query->getResult(); + $discovery_log = $query->getResult(); + foreach ($discovery_log as $log) { + $log->ip_padded = ip_address_to_db($log->ip); + } + $included['discovery_log'] = $discovery_log; $discovery_scan_optionsModel = new \App\Models\DiscoveryScanOptionsModel(); $included['discovery_scan_options'] = $discovery_scan_optionsModel->listUser();