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; } }