mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
Fix context usage (#33554)
Some old code use direct type-casting to get context, it causes problems. This PR fixes all legacy problems and use correct `ctx.Value` to get low-level contexts. Fix #33518
This commit is contained in:
@@ -21,8 +21,8 @@ func FormalRenderHelperFuncs() *markup.RenderHelperFuncs {
|
||||
return false
|
||||
}
|
||||
|
||||
giteaCtx, ok := ctx.(*gitea_context.Context)
|
||||
if !ok {
|
||||
giteaCtx := gitea_context.GetWebContext(ctx)
|
||||
if giteaCtx == nil {
|
||||
// when using general context, use user's visibility to check
|
||||
return mentionedUser.Visibility.IsPublic()
|
||||
}
|
||||
|
Reference in New Issue
Block a user