Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ function ($column) use ($alias) {
return $columns;
}

/**
* Escape against value
* @param string $value
* @return string
*/
private function escapeAgainstValue(string $value): string
{
return preg_replace('/([+\-><\(\)~*\"@]+)/', ' ', $value);
}

/**
* Apply fulltext filters
*
Expand All @@ -86,7 +96,7 @@ public function apply(Collection $collection, Filter $filter)
$collection->getSelect()
->where(
'MATCH(' . implode(',', $columns) . ') AGAINST(?)',
$filter->getValue()
$this->escapeAgainstValue($filter->getValue())
);
}
}