mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fix problems with '#' in branchname
Add proper escaping of '#' in branchname in compare when doing pull requests. This addresses issue #2822.
This commit is contained in:
		@@ -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>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user