瀏覽代碼

templates/repo: escape branch name (#4601)

Unknwon 6 年之前
父節點
當前提交
15f9a83618
共有 4 個文件被更改,包括 5 次插入5 次删除
  1. 2 2
      cmd/hook.go
  2. 1 1
      gogs.go
  3. 1 1
      templates/.VERSION
  4. 1 1
      templates/repo/home.tmpl

+ 2 - 2
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)

+ 1 - 1
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

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.11.47.0425
+0.11.48.0425

+ 1 - 1
templates/repo/home.tmpl

@@ -25,7 +25,7 @@
 		<div class="ui secondary menu">
 			{{if .PullRequestCtx.Allowed}}
 				<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>
 					</a>
 				</div>