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:
parent
e7ebbd1343
commit
3df868f72a
@ -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
|
||||
// ---
|
||||
|
Loading…
x
Reference in New Issue
Block a user