From 15f9a8361809bd557f20ce58753bde7714ae5bf6 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 25 Apr 2018 22:35:50 -0400 Subject: [PATCH] templates/repo: escape branch name (#4601) --- cmd/hook.go | 4 ++-- gogs.go | 2 +- templates/.VERSION | 2 +- templates/repo/home.tmpl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/hook.go b/cmd/hook.go index 8533e3b1d..16ea6b646 100644 --- a/cmd/hook.go +++ b/cmd/hook.go @@ -236,9 +236,9 @@ func runHookPostReceive(c *cli.Context) error { log.Error(2, "PushUpdate: %v", err) } - // Ask for running deliver hook and test pull request tasks. + // Ask for running deliver hook and test pull request tasks reqURL := setting.LocalURL + options.RepoUserName + "/" + options.RepoName + "/tasks/trigger?branch=" + - strings.TrimPrefix(options.RefFullName, git.BRANCH_PREFIX) + + template.EscapePound(strings.TrimPrefix(options.RefFullName, git.BRANCH_PREFIX)) + "&secret=" + os.Getenv(http.ENV_REPO_OWNER_SALT_MD5) + "&pusher=" + os.Getenv(http.ENV_AUTH_USER_ID) log.Trace("Trigger task: %s", reqURL) diff --git a/gogs.go b/gogs.go index a6830a009..1dac9f7e9 100644 --- a/gogs.go +++ b/gogs.go @@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/pkg/setting" ) -const APP_VER = "0.11.47.0425" +const APP_VER = "0.11.48.0425" func init() { setting.AppVer = APP_VER diff --git a/templates/.VERSION b/templates/.VERSION index 58616fef7..8aa524aad 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.11.47.0425 \ No newline at end of file +0.11.48.0425 \ No newline at end of file diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 17e14d6dc..ce49e380a 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -25,7 +25,7 @@