aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-09-07 19:30:52 +0800
committerGitHub <noreply@github.com>2022-09-07 19:30:52 +0800
commit31842f12a4bb22554857f36d1b78b15decd73419 (patch)
tree745cf221148c5011cfef62744c1d970a56c9ff1a
parent32eef4aa2e4c05352413a574f0018fe171e87223 (diff)
downloadgitea-31842f12a4bb22554857f36d1b78b15decd73419.tar.gz
gitea-31842f12a4bb22554857f36d1b78b15decd73419.zip
Add MD5 back to template helper functions to avoid breaking (#21102)
In #20932 the MD5 helper function was removed from template context, it breaks user's customized templates. This PR adds the MD5 helper function back.
-rw-r--r--modules/templates/helper.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index e78dcb61cf..2ea7bdacc6 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -154,6 +154,7 @@ func NewFuncMap() []template.FuncMap {
"DiffTypeToStr": DiffTypeToStr,
"DiffLineTypeToStr": DiffLineTypeToStr,
"ShortSha": base.ShortSha,
+ "MD5": base.EncodeMD5,
"ActionContent2Commits": ActionContent2Commits,
"PathEscape": url.PathEscape,
"PathEscapeSegments": util.PathEscapeSegments,