From cab55c4fae198034b968734b624f58ad07b71c6d Mon Sep 17 00:00:00 2001 From: Mustafa Yildiz Date: Sat, 15 Aug 2026 11:06:41 +0300 Subject: [PATCH] fix: resolve UDF extraction false positive rejection on real UDF content.xml files --- src/controllers/document.controller.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/document.controller.ts b/src/controllers/document.controller.ts index fd0d9b4..a452d92 100644 --- a/src/controllers/document.controller.ts +++ b/src/controllers/document.controller.ts @@ -490,9 +490,9 @@ export async function extractTextFromUploadedFile(file: { buffer: Buffer; mimety .trim(); const cleaned = sanitizePostgresText(plainText); - // Akıllı filtreleme: content.xml, content.xmlPK gibi ZIP başlık isimlerini metin sanma - const isZipNoise = /^content\.xml/i.test(cleaned) || cleaned.includes('content.xmlPK') || cleaned.includes('documentproperties.xml'); - if (cleaned.length > 5 && !cleaned.startsWith('PK') && !isZipNoise) { + // Sadece tek başına "content.xml" veya "content.xmlPK" olan kısa çöp dizgileri süz (Gerçek metinleri kesinlikle engelleme) + const isExactZipHeader = /^content\.xml(PK)?$/i.test(cleaned.trim()) && cleaned.length < 35; + if (cleaned.length > 5 && !cleaned.startsWith('PK') && !isExactZipHeader) { return cleaned; } }