From 40cdc54ae8b5189ed4e104bf0faa17d908b2f7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 20 Jan 2022 15:08:04 +0100 Subject: [PATCH] Convert properties value to string before passing them to database MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids an error when passing a complex property to PROPPATCH under PHP >= 7.4. Signed-off-by: Côme Chilliet --- apps/dav/lib/DAV/CustomPropertiesBackend.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/dav/lib/DAV/CustomPropertiesBackend.php b/apps/dav/lib/DAV/CustomPropertiesBackend.php index 1bd207e0967dd..5f512995ce85c 100644 --- a/apps/dav/lib/DAV/CustomPropertiesBackend.php +++ b/apps/dav/lib/DAV/CustomPropertiesBackend.php @@ -303,6 +303,11 @@ private function updateProperties(string $path, array $properties) { ); } } 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, [