Skip to content

Commit c6b1d66

Browse files
kuchypaveljanda
authored andcommitted
Using SelectBox filter value directly, cast value before explode.
1 parent 8955714 commit c6b1d66

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/DataSource/ArrayDataSource.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,12 @@ protected function applyFilter($row, Filter $filter)
142142
foreach ($condition as $column => $value) {
143143
$value = (string) $value;
144144
$rowVal = (string) $row[$column];
145-
if ($filter instanceof FilterText && $filter->isExactSearch()) {
145+
if (($filter instanceof FilterText && $filter->isExactSearch())
146+
|| $filter instanceof SelectBox) {
146147
return $rowVal === $value;
147148
}
148149

149-
$words = $filter instanceof FilterText && $filter->hasSplitWordsSearch() === false ? [$value] : explode(' ', $value);
150+
$words = $filter instanceof FilterText && $filter->hasSplitWordsSearch() === false ? [$value] : explode(' ', (string) $value);
150151

151152
$row_value = strtolower(Strings::toAscii((string) $row[$column]));
152153

0 commit comments

Comments
 (0)