mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
skip text search for email address if whitespaces
This commit is contained in:
@@ -104,6 +104,14 @@ class DefaultFilter implements Filter
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
!str_contains($attribute, '.') &&
|
||||
$this->metadataProvider->getFieldType($this->entityType, $attribute) === 'email' &&
|
||||
str_contains($filter, ' ')
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
$expression = $filter;
|
||||
|
||||
if (!$skipWildcards) {
|
||||
|
||||
@@ -120,6 +120,17 @@ class MetadataProvider
|
||||
->getType();
|
||||
}
|
||||
|
||||
public function getFieldType(string $entityType, string $field): ?string
|
||||
{
|
||||
$entityDefs = $this->ormDefs->getEntity($entityType);
|
||||
|
||||
if (!$entityDefs->hasField($field)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $entityDefs->getField($field)->getType();
|
||||
}
|
||||
|
||||
public function getRelationEntityType(string $entityType, string $link): ?string
|
||||
{
|
||||
$relationDefs = $this->ormDefs
|
||||
|
||||
Reference in New Issue
Block a user