From 9bc6809937656f49e9155b5d6a3fb148c63a2c13 Mon Sep 17 00:00:00 2001 From: Rom1-B <8530352+Rom1-B@users.noreply.github.com> Date: Thu, 23 Jul 2026 10:37:44 +0200 Subject: [PATCH] Fix: decode group search filter as array instead of object --- CHANGELOG.md | 6 ++++++ inc/computergroupdynamic.class.php | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e009a8..c68a730 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] + +### Fixed + +- Decode dynamic group search filter as an array instead of an object + ## [1.1.3] - 2026-05-05 ### Fixed diff --git a/inc/computergroupdynamic.class.php b/inc/computergroupdynamic.class.php index 8c4492d..a61eac8 100644 --- a/inc/computergroupdynamic.class.php +++ b/inc/computergroupdynamic.class.php @@ -29,6 +29,7 @@ */ use function Safe\json_decode; +use function Safe\unserialize; use function Safe\json_encode; use function Safe\ob_start; use function Safe\ob_get_clean; @@ -182,7 +183,7 @@ private function countDynamicItems() public function isDynamicSearchMatchComputer(Computer $computer) { // add new criteria to force computer ID - $search = json_decode((string) $this->fields['search']); + $search = json_decode((string) $this->fields['search'], true, 512, JSON_THROW_ON_ERROR); $search['criteria'][] = [ 'link' => 'AND',