mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-16 11:08:14 +02:00
cap the file name before normalization
This commit is contained in:
1 parent
c2d6530065
commit
d08da7594a
2 files changed
+10
-2
No files matched your search
@@ -193,6 +193,13 @@ var extInvalidCharsRegex = regexp.MustCompile(`[^\w\.\*\-\+\=\#]+`)
|
||||
const randomAlphabet = "abcdefghijklmnopqrstuvwxyz0123456789"
|
||||
|
||||
func normalizeName(fr FileReader, name string) string {
|
||||
// cut the name even if it is not multibyte safe to avoid operating on too large strings
|
||||
// ---
|
||||
originalLength := len(name)
|
||||
if originalLength > 300 {
|
||||
name = name[originalLength-300:]
|
||||
}
|
||||
|
||||
// extension
|
||||
// ---
|
||||
originalExt := extractExtension(name)
|
||||
|
||||
Reference in new issue
Block a user