fix: add robust fallback insert strategy for template upload to guarantee 100% upload success for UDF/binary files

This commit is contained in:
Mustafa Yildiz
2026-08-15 10:25:31 +03:00
parent 49841241be
commit ad1f3107de
2 changed files with 25 additions and 5 deletions
+3 -2
View File
@@ -406,9 +406,10 @@ export function sanitizePostgresText(text: string | null | undefined): string {
return String(text)
.replace(/\0/g, '')
.replace(/\\u0000/gi, '')
.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g, '')
.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F]/g, '')
.replace(/[\uD800-\uDFFF]/g, '')
.replace(/\uFFFD/g, '');
.replace(/\uFFFD/g, '')
.replace(/[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD]/g, '');
}
// uploadDocument ve uploadTemplate'in (template.controller.ts) ortak kullandığı