aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Files/FileSearchBackend.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/Files/FileSearchBackend.php')
-rw-r--r--apps/dav/lib/Files/FileSearchBackend.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php
index 1b785962112..ace367e4490 100644
--- a/apps/dav/lib/Files/FileSearchBackend.php
+++ b/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 ?? ''
);