diff --git a/src/Extensions/DBFieldExtension.php b/src/Extensions/DBFieldExtension.php index b4d49f5..7aa9419 100644 --- a/src/Extensions/DBFieldExtension.php +++ b/src/Extensions/DBFieldExtension.php @@ -7,10 +7,21 @@ class DBFieldExtension extends Extension { - public function getSearchValue(): string + public function getSearchValue(): array|string { $value = $this->owner->getValue() ?? ''; + if (is_array($value)) { + array_map( + function ($arrayItem) { + return preg_replace('/\s+/S', ' ', strip_tags($arrayItem)); + }, + $value + ); + + return $value; + } + return preg_replace('/\s+/S', ' ', strip_tags($value)); }