diff --git a/includes/components/filter.class.php b/includes/components/filter.class.php index 3a7f03ef..d9f6fefd 100644 --- a/includes/components/filter.class.php +++ b/includes/components/filter.class.php @@ -229,14 +229,21 @@ abstract class Filter $this->cndSet = $this->createSQLForValues(); // criteria + $filters = []; foreach ($this->criteriaIterator() as $_cr) if ($cnd = $this->createSQLForCriterium(...$_cr)) - $this->cndSet[] = $cnd; + $filters[] = $cnd; - if ($this->cndSet) // Note: TYPE_SOUND does not use 'match any' - array_unshift($this->cndSet, empty($this->values['ma']) ? 'AND' : 'OR'); + if ($filters) // if a filter uses criteria it must have a [ma]tch selector + { + $filters[] = empty($this->values['ma']) ? 'AND' : 'OR'; + $this->cndSet[] = $filters; + } } + if ($this->cndSet) + array_unshift($this->cndSet, 'AND'); + return $this->cndSet; } diff --git a/includes/dbtypes/item.class.php b/includes/dbtypes/item.class.php index 1073f666..1a0ef207 100644 --- a/includes/dbtypes/item.class.php +++ b/includes/dbtypes/item.class.php @@ -2130,14 +2130,14 @@ class ItemListFilter extends Filter } // quality [list] - if ($_v['qu'] !== null) + if ($_v['qu']) $parts[] = ['quality', $_v['qu']]; - // type - if ($_v['ty'] !== null) + // type [list] + if ($_v['ty']) $parts[] = ['subclass', $_v['ty']]; - // slot + // slot [list] if ($_v['sl']) $parts[] = ['slot', $_v['sl']]; diff --git a/includes/dbtypes/quest.class.php b/includes/dbtypes/quest.class.php index 49909d32..9008d7e5 100644 --- a/includes/dbtypes/quest.class.php +++ b/includes/dbtypes/quest.class.php @@ -549,7 +549,7 @@ class QuestListFilter extends Filter } // questInfoId [list] - if ($_v['ty'] !== null) + if ($_v['ty']) $parts[] = ['questInfoId', $_v['ty']]; return $parts;