Remove ASCII-only restriction on media filenames. Closes #2277.

This commit is contained in:
Kailash Nadh 2025-03-29 14:06:57 +05:30
parent 0be7a79dac
commit 5f1b676401
2 changed files with 0 additions and 14 deletions

View file

@ -48,10 +48,6 @@ func handleUploadMedia(c echo.Context) error {
ext = strings.TrimPrefix(strings.ToLower(filepath.Ext(file.Filename)), ".")
contentType = file.Header.Get("Content-Type")
)
if !isASCII(file.Filename) {
return echo.NewHTTPError(http.StatusUnprocessableEntity,
app.i18n.Ts("media.invalidFileName", "name", file.Filename))
}
// Validate file extension.
if !inArray("*", app.constants.MediaUpload.Extensions) {

View file

@ -8,7 +8,6 @@ import (
"regexp"
"strconv"
"strings"
"unicode"
"golang.org/x/text/cases"
"golang.org/x/text/language"
@ -124,12 +123,3 @@ func titleCase(input string) string {
return strings.Join(parts, " ")
}
func isASCII(s string) bool {
for _, c := range s {
if c > unicode.MaxASCII {
return false
}
}
return true
}