aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2023-07-14 15:08:38 +0900
committerGitHub <noreply@github.com>2023-07-14 06:08:38 +0000
commit61c9268c56bce5da47bbf87c790c2694a593b763 (patch)
treebac3881a1af355b920eadc73fe76cc1b667b1759
parent4628aa5251ad1a9785f449fb43c7dfe3f01178cf (diff)
downloadgitea-61c9268c56bce5da47bbf87c790c2694a593b763.tar.gz
gitea-61c9268c56bce5da47bbf87c790c2694a593b763.zip
Fix wrong usage of PathEscapeSegments in branch list page (#25864)
Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/21ce7bfa-36f7-4125-9a66-d644400916a8) emmm, don't know how to write a good title to describe this issue. If you have a good idea, I can change the title. The fix code is copied from L122. Not sure it is right or not. @lunny Maybe `DefaultBranchBranch` is also typo? Two `Branch` in variable name .
-rw-r--r--templates/repo/branch/list.tmpl2
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl
index e9d5cc1efb..297427eeeb 100644
--- a/templates/repo/branch/list.tmpl
+++ b/templates/repo/branch/list.tmpl
@@ -125,7 +125,7 @@
{{end}}
{{else if and .LatestPullRequest.HasMerged .MergeMovedOn}}
{{if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
- <a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{$.Owner.Name}}:{{end}}{{.Name | PathEscapeSegments}}">
+ <a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}">
<button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{$.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{$.locale.Tr "action.compare_branch"}}{{end}}</button>
</a>
{{end}}