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/projects.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/projects.go')
-rw-r--r-- | routers/web/repo/projects.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go index 9afbf0165d..556656e5b5 100644 --- a/routers/web/repo/projects.go +++ b/routers/web/repo/projects.go @@ -82,6 +82,7 @@ func Projects(ctx *context.Context) { URLPrefix: ctx.Repo.RepoLink, Metas: ctx.Repo.Repository.ComposeMetas(), GitRepo: ctx.Repo.GitRepo, + Ctx: ctx, }, projects[i].Description) if err != nil { ctx.ServerError("RenderString", err) @@ -324,6 +325,7 @@ func ViewProject(ctx *context.Context) { URLPrefix: ctx.Repo.RepoLink, Metas: ctx.Repo.Repository.ComposeMetas(), GitRepo: ctx.Repo.GitRepo, + Ctx: ctx, }, project.Description) if err != nil { ctx.ServerError("RenderString", err) |