diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 036016e1c9766..8ab1622eb9e62 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -478,7 +478,7 @@ public function writeStream(string $path, $stream, ?int $size = null): int { $metadata = [ 'mimetype' => $mimetype, 'original-storage' => $this->getId(), - 'original-path' => $path, + 'original-path' => preg_replace('/\s+/', ' ', $path) ?? $path, ]; if ($size) { $metadata['size'] = $size;