diff --git a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php index f37829a26..4fec9f6ca 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php @@ -354,7 +354,7 @@ class StoredObject implements Document, TrackCreationInterface public static function generatePrefix(): string { try { - return base_convert(bin2hex(random_bytes(8)), 16, 36); + return base_convert(bin2hex(random_bytes(32)), 16, 36); } catch (RandomException $e) { return uniqid(more_entropy: true); } diff --git a/src/Bundle/ChillDocStoreBundle/Entity/StoredObjectVersion.php b/src/Bundle/ChillDocStoreBundle/Entity/StoredObjectVersion.php index c280b30a3..2b8852513 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/StoredObjectVersion.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/StoredObjectVersion.php @@ -82,7 +82,7 @@ class StoredObjectVersion implements TrackCreationInterface public static function generateFilename(StoredObjectVersion $storedObjectVersion): string { try { - $suffix = base_convert(bin2hex(random_bytes(16)), 16, 36); + $suffix = base_convert(bin2hex(random_bytes(8)), 16, 36); } catch (RandomException $e) { $suffix = uniqid(more_entropy: true); } diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php index 574fee75b..639133976 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php @@ -104,7 +104,7 @@ final readonly class ChillDocumentManager implements DocumentManagerInterface throw new \Error('Unknown mimetype for stored document.'); } - return sprintf('%s.%s', $document->getFilename(), reset($exts)); + return sprintf('%s.%s', $document->getPrefix(), reset($exts)); } /**