fix: resolve UDF extraction false positive rejection on real UDF content.xml files
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user