aboutsummaryrefslogtreecommitdiffstats
path: root/modules/validation/helpers.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/validation/helpers.go')
-rw-r--r--modules/validation/helpers.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/validation/helpers.go b/modules/validation/helpers.go
index 9f6cf5201a..ba383ba195 100644
--- a/modules/validation/helpers.go
+++ b/modules/validation/helpers.go
@@ -7,6 +7,7 @@ import (
"net"
"net/url"
"regexp"
+ "slices"
"strings"
"sync"
@@ -55,12 +56,7 @@ func IsValidSiteURL(uri string) bool {
return false
}
- for _, scheme := range setting.Service.ValidSiteURLSchemes {
- if scheme == u.Scheme {
- return true
- }
- }
- return false
+ return slices.Contains(setting.Service.ValidSiteURLSchemes, u.Scheme)
}
// IsEmailDomainListed checks whether the domain of an email address