Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop double encoding blame commit messages #17498

Conversation

zeripath
Copy link
Contributor

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

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 go-gitea#17492

Signed-off-by: Andrew Thornton <art27@cantab.net>
@codecov-commenter
Copy link

Codecov Report

Merging #17498 (cb5ba56) into main (40c8451) will increase coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17498      +/-   ##
==========================================
+ Coverage   45.49%   45.51%   +0.02%     
==========================================
  Files         791      791              
  Lines       88717    88717              
==========================================
+ Hits        40365    40383      +18     
+ Misses      41839    41822      -17     
+ Partials     6513     6512       -1     
Impacted Files Coverage Δ
routers/web/repo/blame.go 0.00% <0.00%> (ø)
modules/git/repo_base_nogogit.go 82.85% <0.00%> (-2.86%) ⬇️
modules/git/utils.go 68.05% <0.00%> (-2.78%) ⬇️
modules/process/manager.go 72.83% <0.00%> (-2.47%) ⬇️
models/issue_comment.go 51.60% <0.00%> (-0.30%) ⬇️
services/pull/pull.go 42.19% <0.00%> (+0.40%) ⬆️
routers/web/repo/view.go 40.20% <0.00%> (+0.51%) ⬆️
modules/queue/queue_bytefifo.go 63.47% <0.00%> (+0.59%) ⬆️
models/notification.go 66.15% <0.00%> (+0.87%) ⬆️
modules/notification/ui/ui.go 62.31% <0.00%> (+1.44%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ff944f...cb5ba56. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 31, 2021
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Oct 31, 2021
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Oct 31, 2021
@lafriks lafriks merged commit 4e8a817 into go-gitea:main Oct 31, 2021
@zeripath zeripath deleted the fix-17492-no-double-html-encoding-commit-message branch October 31, 2021 09:11
zeripath added a commit to zeripath/gitea that referenced this pull request Oct 31, 2021
Backport go-gitea#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 go-gitea#17492

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added the backport/done All backports for this PR have been created label Oct 31, 2021
wxiaoguang pushed a commit that referenced this pull request Oct 31, 2021
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>
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
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 go-gitea#17492

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad HTML encoding in blames
5 participants