Skip to content

Commit c8ec037

Browse files
fix: replace null character when serializing
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
1 parent 6230849 commit c8ec037

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/dav/lib/DAV/CustomPropertiesBackend.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public function propFind($path, PropFind $propFind) {
226226
} catch (DavException $e) {
227227
continue;
228228
}
229-
$propFind->set($propName, $propValue);
229+
$propFind->set($propName, $propValue);
230230
}
231231
foreach ($this->getUserProperties($path, $requestedProps) as $propName => $propValue) {
232232
try {
@@ -519,7 +519,9 @@ private function encodeValueForDatabase(string $path, string $name, mixed $value
519519
$value = $value->getHref();
520520
} else {
521521
$valueType = self::PROPERTY_TYPE_OBJECT;
522-
$value = serialize($value);
522+
// serialize produces null character
523+
// these can not be properly stored in some databases and need to be replaced
524+
$value = str_replace(chr(0), ' ', serialize($value));
523525
}
524526
return [$value, $valueType];
525527
}

0 commit comments

Comments
 (0)