Backport #17498 The call to html.EscapeString in routers/web/repo/blame.go:renderBlame is extraneous as the commit message is now rendered by the template. The template will correctly escape strings - therefore we are currently double escaping. This PR fixes this. Fix #17492 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		
							parent
							
								
									34650b925b
								
							
						
					
					
						commit
						9340269d84
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		|  | @ -7,7 +7,6 @@ package repo | ||||||
| import ( | import ( | ||||||
| 	"container/list" | 	"container/list" | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"html" |  | ||||||
| 	gotemplate "html/template" | 	gotemplate "html/template" | ||||||
| 	"net/http" | 	"net/http" | ||||||
| 	"strings" | 	"strings" | ||||||
|  | @ -244,7 +243,7 @@ func renderBlame(ctx *context.Context, blameParts []git.BlamePart, commitNames m | ||||||
| 				br.PreviousSha = previousSha | 				br.PreviousSha = previousSha | ||||||
| 				br.PreviousShaURL = fmt.Sprintf("%s/blame/commit/%s/%s", repoLink, previousSha, ctx.Repo.TreePath) | 				br.PreviousShaURL = fmt.Sprintf("%s/blame/commit/%s/%s", repoLink, previousSha, ctx.Repo.TreePath) | ||||||
| 				br.CommitURL = fmt.Sprintf("%s/commit/%s", repoLink, part.Sha) | 				br.CommitURL = fmt.Sprintf("%s/commit/%s", repoLink, part.Sha) | ||||||
| 				br.CommitMessage = html.EscapeString(commit.CommitMessage) | 				br.CommitMessage = commit.CommitMessage | ||||||
| 				br.CommitSince = commitSince | 				br.CommitSince = commitSince | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue