Skip to content

Commit

Permalink
fix: replace null character when serializing
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <[email protected]>
  • Loading branch information
SebastianKrupinski committed Nov 28, 2024
1 parent 659cd12 commit 7e22304
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/dav/lib/DAV/CustomPropertiesBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,9 @@ private function encodeValueForDatabase(string $path, string $name, mixed $value
$value = $value->getHref();
} else {
$valueType = self::PROPERTY_TYPE_OBJECT;
$value = serialize($value);
// serialize produces null character
// these can not be properly stored in some databases and need to be replaced
$value = str_replace(chr(0), ' ', serialize($value));
}
return [$value, $valueType];
}
Expand Down

0 comments on commit 7e22304

Please sign in to comment.