diff options
author | zeripath <art27@cantab.net> | 2021-08-28 21:15:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-28 21:15:56 +0100 |
commit | c9c0475f4d664766c174a4563ba9ec210cadfeac (patch) | |
tree | 817ae8782c3510cc14c1dc91f4cd821f0dea8e5a /routers/web/repo/issue.go | |
parent | 90c01804470f45018de0653a19d5211c986c035c (diff) | |
download | gitea-c9c0475f4d664766c174a4563ba9ec210cadfeac.tar.gz gitea-c9c0475f4d664766c174a4563ba9ec210cadfeac.zip |
In Render tolerate not being passed a context (#16842)
* In Render tolerate not being passed a context
It is possible for RenderString to be passed to an external renderer if markdown
is set to be rendered by an external renderer. No context is currently sent to these
meaning that this will error out.
Fix #16835
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add Context to Repo calls for RenderString
All calls from routers can easily add the context - so add it.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/web/repo/issue.go')
-rw-r--r-- | routers/web/repo/issue.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 59ffe1edb1..3f7af7a51f 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -1138,6 +1138,7 @@ func ViewIssue(ctx *context.Context) { URLPrefix: ctx.Repo.RepoLink, Metas: ctx.Repo.Repository.ComposeMetas(), GitRepo: ctx.Repo.GitRepo, + Ctx: ctx, }, issue.Content) if err != nil { ctx.ServerError("RenderString", err) @@ -1303,6 +1304,7 @@ func ViewIssue(ctx *context.Context) { URLPrefix: ctx.Repo.RepoLink, Metas: ctx.Repo.Repository.ComposeMetas(), GitRepo: ctx.Repo.GitRepo, + Ctx: ctx, }, comment.Content) if err != nil { ctx.ServerError("RenderString", err) @@ -1379,6 +1381,7 @@ func ViewIssue(ctx *context.Context) { URLPrefix: ctx.Repo.RepoLink, Metas: ctx.Repo.Repository.ComposeMetas(), GitRepo: ctx.Repo.GitRepo, + Ctx: ctx, }, comment.Content) if err != nil { ctx.ServerError("RenderString", err) @@ -1739,6 +1742,7 @@ func UpdateIssueContent(ctx *context.Context) { URLPrefix: ctx.FormString("context"), Metas: ctx.Repo.Repository.ComposeMetas(), GitRepo: ctx.Repo.GitRepo, + Ctx: ctx, }, issue.Content) if err != nil { ctx.ServerError("RenderString", err) @@ -2170,6 +2174,7 @@ func UpdateCommentContent(ctx *context.Context) { URLPrefix: ctx.FormString("context"), Metas: ctx.Repo.Repository.ComposeMetas(), GitRepo: ctx.Repo.GitRepo, + Ctx: ctx, }, comment.Content) if err != nil { ctx.ServerError("RenderString", err) |