diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-01-20 15:08:04 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-01-20 15:08:04 +0100 |
commit | 40cdc54ae8b5189ed4e104bf0faa17d908b2f7d6 (patch) | |
tree | 6f770438e16d70e92ab129fae101b09eab7975e4 /apps/dav/lib/DAV | |
parent | de9fe8fcc101106f1ac3d6113616c10f89c1601e (diff) | |
download | nextcloud-server-40cdc54ae8b5189ed4e104bf0faa17d908b2f7d6.tar.gz nextcloud-server-40cdc54ae8b5189ed4e104bf0faa17d908b2f7d6.zip |
Convert properties value to string before passing them to database
This avoids an error when passing a complex property to PROPPATCH under
PHP >= 7.4.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/dav/lib/DAV')
-rw-r--r-- | apps/dav/lib/DAV/CustomPropertiesBackend.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/dav/lib/DAV/CustomPropertiesBackend.php b/apps/dav/lib/DAV/CustomPropertiesBackend.php index 1bd207e0967..5f512995ce8 100644 --- a/apps/dav/lib/DAV/CustomPropertiesBackend.php +++ b/apps/dav/lib/DAV/CustomPropertiesBackend.php @@ -303,6 +303,11 @@ class CustomPropertiesBackend implements BackendInterface { ); } } else { + if ($propertyValue instanceOf \Sabre\DAV\Xml\Property\Complex) { + $propertyValue = $propertyValue->getXml(); + } elseif (!is_string($propertyValue)) { + $propertyValue = (string)$propertyValue; + } if (!array_key_exists($propertyName, $existing)) { $this->connection->executeUpdate($insertStatement, [ |