templates/repo: escape branch name (#4601)

This commit is contained in:
Unknwon
2018-04-25 22:35:50 -04:00
parent d572381a37
commit 15f9a83618
4 changed files with 5 additions and 5 deletions

View File

@@ -236,9 +236,9 @@ func runHookPostReceive(c *cli.Context) error {
log.Error(2, "PushUpdate: %v", err) 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=" + 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) + "&secret=" + os.Getenv(http.ENV_REPO_OWNER_SALT_MD5) +
"&pusher=" + os.Getenv(http.ENV_AUTH_USER_ID) "&pusher=" + os.Getenv(http.ENV_AUTH_USER_ID)
log.Trace("Trigger task: %s", reqURL) log.Trace("Trigger task: %s", reqURL)

View File

@@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
) )
const APP_VER = "0.11.47.0425" const APP_VER = "0.11.48.0425"
func init() { func init() {
setting.AppVer = APP_VER setting.AppVer = APP_VER

View File

@@ -1 +1 @@
0.11.47.0425 0.11.48.0425

View File

@@ -25,7 +25,7 @@
<div class="ui secondary menu"> <div class="ui secondary menu">
{{if .PullRequestCtx.Allowed}} {{if .PullRequestCtx.Allowed}}
<div class="fitted item"> <div class="fitted item">
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{.PullRequestCtx.HeadInfo}}"> <a href="{{.BaseRepo.Link}}/compare/{{EscapePound .BaseRepo.DefaultBranch}}...{{EscapePound .PullRequestCtx.HeadInfo}}">
<button class="ui green small button"><i class="octicon octicon-git-compare"></i></button> <button class="ui green small button"><i class="octicon octicon-git-compare"></i></button>
</a> </a>
</div> </div>