1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-03-18 21:57:50 +02:00

added extra extension length normalization

This commit is contained in:
Gani Georgiev 2024-04-24 23:20:47 +03:00
parent e7ebbd1343
commit 3df868f72a

View File

@ -177,6 +177,10 @@ func normalizeName(fr FileReader, name string) string {
// try to detect the extension from the file content
cleanExt, _ = detectExtension(fr)
}
if extLength := len(cleanExt); extLength > 20 {
// keep only the last 20 characters (it is multibyte safe after the regex replace)
cleanExt = "." + cleanExt[extLength-20:]
}
// name
// ---