make sure path check is safe

This commit is contained in:
Lanre Adelowo 2018-07-21 20:26:26 +01:00
parent 5a2ea86adf
commit 3b87fefe2b

View File

@ -39,7 +39,8 @@ func Toggle(options *ToggleOptions) macaron.Handler {
return
}
if ctx.Req.URL.Path == "/user/change_password" {
// prevent infinite redirection
if ctx.Req.URL.Path == setting.AppSubURL+"/user/change_password" {
return
} else if ctx.User.MustChangePassword {
ctx.Data["Title"] = ctx.Tr("auth.must_change_password")