From 4e1bd775f97fb064a57bb850cc6f88536b9a042c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 6 Mar 2020 14:47:39 +0100 Subject: [PATCH] HostgroupController: Don't apply `id` filter using the `FilterProcessor` Ids are binary strings which may contain asterisks. These are then interpreted as wildcard by the filter processor. --- application/controllers/HostgroupController.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/application/controllers/HostgroupController.php b/application/controllers/HostgroupController.php index 12d98550..bb068a98 100644 --- a/application/controllers/HostgroupController.php +++ b/application/controllers/HostgroupController.php @@ -43,13 +43,9 @@ class HostgroupController extends Controller { $db = $this->getDb(); - $hosts = Host::on($db)->with('state'); - - FilterProcessor::apply( - new FilterExpression('hostgroup.id', '=', $this->hostgroup->id), - $hosts - ); + $hosts = Host::on($db)->with('state')->utilize('hostgroup'); + $hosts->getSelectBase()->where(['host_hostgroup.id = ?' => $this->hostgroup->id]); $this->applyMonitoringRestriction($hosts); $limitControl = $this->createLimitControl();