mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user