Fix request filter for selections

This commit is contained in:
Jake Barnby 2025-08-27 03:44:27 +12:00
parent c9f9db722b
commit b7633969b4
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -33,7 +33,7 @@ class V20 extends Filter
protected function manageSelectQueries(array $content): array
{
$hasWildcard = false;
if (! isset($content['queries'])) {
if (!isset($content['queries'])) {
$hasWildcard = true;
// only query, make it json encoded!
$content['queries'] = [Query::select(['*'])->toString()];
@ -48,7 +48,11 @@ class V20 extends Filter
$selections = Query::groupByType($parsed)['selections'] ?? [];
if (! $hasWildcard) {
// If there are no select queries at all, add wildcard
if (empty($selections)) {
$hasWildcard = true;
$parsed[] = Query::select(['*']);
} else if (!$hasWildcard) {
// check if any select includes a wildcard as we added one above
foreach ($selections as $select) {
if (\in_array('*', $select->getValues(), true)) {