feat: improve office document discovert

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-09-07 12:55:41 -04:00
parent 8e98e0749a
commit dec645e6ab
+3 -3
View File
@@ -712,8 +712,8 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
throw new InvalidParameterException("Entity not found: $identifier"); throw new InvalidParameterException("Entity not found: $identifier");
} }
// detect MIME type and format from content header // detect MIME type and format from content (full content lets us tell OOXML/ODF apart from a plain zip)
$signature = Signature::detect(substr($data, 0, Signature::HEADER_SIZE)); $signature = Signature::detect(substr($data, 0, Signature::SAMPLE_SIZE), $data);
// Write blob data // Write blob data
$size = $this->blobStore->blobWrite((string)$identifier, $data); $size = $this->blobStore->blobWrite((string)$identifier, $data);
@@ -779,7 +779,7 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI
// Detect MIME type and format from first chunk (offset === 0) // Detect MIME type and format from first chunk (offset === 0)
$signature = null; $signature = null;
if ($offset === 0) { if ($offset === 0) {
$signature = Signature::detect(substr($data, 0, Signature::HEADER_SIZE)); $signature = Signature::detect(substr($data, 0, Signature::SAMPLE_SIZE), $data);
} }
$bytes = $this->blobStore->blobWriteChunk((string)$identifier, $offset, $data); $bytes = $this->blobStore->blobWriteChunk((string)$identifier, $offset, $data);