From: wxiaoguang Date: Wed, 7 Sep 2022 11:30:52 +0000 (+0800) Subject: Add MD5 back to template helper functions to avoid breaking (#21102) X-Git-Tag: v1.17.3~30 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=31842f12a4bb22554857f36d1b78b15decd73419;p=gitea.git 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. --- 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,