]> source.dussan.org Git - gitea.git/commitdiff
Fix problems with '#' in branchname
authorOdin Ugedal <odin@ugedal.com>
Tue, 15 Mar 2016 10:31:35 +0000 (11:31 +0100)
committerOdin Ugedal <odin@ugedal.com>
Tue, 15 Mar 2016 10:36:23 +0000 (11:36 +0100)
Add proper escaping of '#' in branchname in compare when doing pull
requests. This addresses issue #2822.

templates/repo/pulls/compare.tmpl

index 0d7b6f9b55fb8e18af3826c39a4dd7b168a08c13..7069fe3f0547e185ef7134fd58166bf9113ae555 100644 (file)
@@ -21,7 +21,7 @@
                                                </div>
                                                <div class="scrolling menu">
                                                        {{range .Branches}}
-                                                               <div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-url="{{$.RepoLink}}/compare/{{.}}...{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}:{{end}}{{$.HeadBranch}}">{{.}}</div>
+                                                               <div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-url="{{$.RepoLink}}/compare/{{EscapePound .}}...{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}:{{end}}{{EscapePound $.HeadBranch}}">{{.}}</div>
                                                        {{end}}
                                                </div>
                                        </div>
@@ -39,7 +39,7 @@
                                                </div>
                                                <div class="scrolling menu">
                                                        {{range .HeadBranches}}
-                                                               <div class="{{if eq $.HeadBranch .}}selected{{end}} item" data-url="{{$.RepoLink}}/compare/{{$.BaseBranch}}...{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}:{{end}}{{.}}">{{.}}</div>
+                                                               <div class="{{if eq $.HeadBranch .}}selected{{end}} item" data-url="{{$.RepoLink}}/compare/{{EscapePound $.BaseBranch}}...{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}:{{end}}{{EscapePound .}}">{{.}}</div>
                                                        {{end}}
                                                </div>
                                        </div>