]> source.dussan.org Git - gitea.git/commitdiff
Add MD5 back to template helper functions to avoid breaking (#21102)
authorwxiaoguang <wxiaoguang@gmail.com>
Wed, 7 Sep 2022 11:30:52 +0000 (19:30 +0800)
committerGitHub <noreply@github.com>
Wed, 7 Sep 2022 11:30:52 +0000 (19:30 +0800)
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.

modules/templates/helper.go

index e78dcb61cfa0498f548f7537bd7932e9b7dbfe66..2ea7bdacc69553b01cc155e0567b6feb044c14d8 100644 (file)
@@ -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,