aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2018-04-25 22:35:50 -0400
committerUnknwon <u@gogs.io>2018-04-25 22:35:50 -0400
commit15f9a8361809bd557f20ce58753bde7714ae5bf6 (patch)
treede2de559e536849cdc10c90555c8bfd96fef4f48 /cmd
parentd572381a37020f8a3d9c1e01bc37f8cfc48aaccb (diff)
templates/repo: escape branch name (#4601)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hook.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/hook.go b/cmd/hook.go
index 8533e3b1..16ea6b64 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)