mirror of
https://github.com/nextcloud/server.git
synced 2026-03-18 16:45:22 -04:00
Merge pull request #51592 from nextcloud/fix/search-cast
fix(dav): throw invalid argument when property type does not match
This commit is contained in:
commit
698146c366
1 changed files with 7 additions and 1 deletions
|
|
@ -422,10 +422,16 @@ class FileSearchBackend implements ISearchBackend {
|
|||
$field = $this->mapPropertyNameToColumn($property);
|
||||
}
|
||||
|
||||
try {
|
||||
$castedValue = $this->castValue($property, $value ?? '');
|
||||
} catch (\Error $e) {
|
||||
throw new \InvalidArgumentException('Invalid property value for ' . $property->name, previous: $e);
|
||||
}
|
||||
|
||||
return new SearchComparison(
|
||||
$trimmedType,
|
||||
$field,
|
||||
$this->castValue($property, $value ?? ''),
|
||||
$castedValue,
|
||||
$extra ?? ''
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue