From 43aa000f02afe428d7ca1003e5fab4332a580651 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 24 Mar 2023 11:33:10 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#1709 --- wire/core/PageFinder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/core/PageFinder.php b/wire/core/PageFinder.php index 0446be72..ee39fed6 100644 --- a/wire/core/PageFinder.php +++ b/wire/core/PageFinder.php @@ -2775,8 +2775,8 @@ class PageFinder extends Wire { // parentIDs or IDs found via another query, and we don't need to match anything other than the parent ID $in = $not ? "NOT IN" : "IN"; $sql .= in_array($field, array('parent', 'parent_id')) ? "$table.parent_id " : "$table.id "; - $IDs = $sanitizer->intArray($IDs); - $strIDs = implode(',', $IDs); + $IDs = $sanitizer->intArray($IDs, array('strict' => true)); + $strIDs = count($IDs) ? implode(',', $IDs) : '-1'; $sql .= "$in($strIDs)"; if($subfield === 'sort') $query->orderby("FIELD($table.id, $strIDs)"); unset($strIDs);