Merge pull request #51592 from nextcloud/fix/search-cast

fix(dav): throw invalid argument when property type does not match
pull/52526/head
Ferdinand Thiessen 5 months ago committed by GitHub
commit 698146c366
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      apps/dav/lib/Files/FileSearchBackend.php

@ -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…
Cancel
Save