fix: resolve UDF extraction false positive rejection on real UDF content.xml files

This commit is contained in:
Mustafa Yildiz
2026-08-15 11:06:41 +03:00
parent 389bbe33ef
commit cab55c4fae
+3 -3
View File
@@ -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;
}
}