Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

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

Kailash Nadh5f1b676401e9
diff --git a/cmd/media.go b/cmd/media.go
index 1885d7aa..39d420c1 100644
--- a/cmd/media.go
+++ b/cmd/media.go
@@ -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) {
diff --git a/cmd/utils.go b/cmd/utils.go
index 04859e41..7c48ab66 100644
--- a/cmd/utils.go
+++ b/cmd/utils.go
@@ -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
-}