userpage: fix redirect on contact method change

root userpage paths ("") would mess up the redirect, wrapper function
returns "/" if thats the case. For #455.
This commit is contained in:
Harvey Tindall
2025-12-16 18:32:37 +00:00
parent e4e9369d54
commit 315d74eb2d
2 changed files with 9 additions and 2 deletions

View File

@@ -66,6 +66,13 @@ func FixFullURL(v string) string {
return v
}
func MustGetNonEmptyURL(path string) string {
if !strings.HasPrefix(path, "/") {
return "/" + path
}
return path
}
func FormatSubpath(path string, removeSingleSlash bool) string {
if path == "/" {
if removeSingleSlash {