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>
This commit is contained in:
Côme Chilliet 2022-01-20 15:08:04 +01:00
parent de9fe8fcc1
commit 40cdc54ae8
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -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,
[