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

Fix data URI scramble #16098

Merged
merged 4 commits into from
Jun 7, 2021
Merged

Fix data URI scramble #16098

merged 4 commits into from
Jun 7, 2021

Conversation

KN4CK3R
Copy link
Member

@KN4CK3R KN4CK3R commented Jun 7, 2021

Fixes #16020

util.URLJoin("/dummy", "data:image/png;base64,i//V") results in data:image/png;base64,i/V (a slash is missing) which breaks images.

@codecov-commenter
Copy link

Codecov Report

Merging #16098 (89c7320) into main (ee5e1c4) will increase coverage by 0.11%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16098      +/-   ##
==========================================
+ Coverage   44.06%   44.18%   +0.11%     
==========================================
  Files         683      684       +1     
  Lines       82358    82325      -33     
==========================================
+ Hits        36295    36375      +80     
+ Misses      40176    40064     -112     
+ Partials     5887     5886       -1     
Impacted Files Coverage Δ
modules/markup/sanitizer.go 91.37% <ø> (+2.49%) ⬆️
modules/markup/html.go 76.95% <33.33%> (-0.60%) ⬇️
modules/markup/renderer.go 67.00% <0.00%> (-5.53%) ⬇️
modules/git/repo_base_nogogit.go 82.85% <0.00%> (-2.86%) ⬇️
modules/git/utils.go 62.50% <0.00%> (-2.78%) ⬇️
modules/git/commit_info_nogogit.go 67.12% <0.00%> (-0.97%) ⬇️
routers/repo/pull.go 30.37% <0.00%> (-0.79%) ⬇️
routers/api/v1/repo/branch.go 38.14% <0.00%> (-0.34%) ⬇️
modules/repository/cache.go 36.84% <0.00%> (ø)
... and 20 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 b3ef6a6...89c7320. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 7, 2021
Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice refactor too ;)

@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 Jun 7, 2021
@6543
Copy link
Member

6543 commented Jun 7, 2021

@KN4CK3R could you add this specific test case to the tests (make sure it wont break again)?

@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 Jun 7, 2021
@6543 6543 merged commit 21cde5c into go-gitea:main Jun 7, 2021
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Jun 9, 2021
* Removed unused method.

* No prefix for data uris.

* Added test to prevent regressions.
@6543 6543 added the backport/done All backports for this PR have been created label Jun 9, 2021
@6543
Copy link
Member

6543 commented Jun 9, 2021

-> #16118

6543 added a commit that referenced this pull request Jun 9, 2021
* Fix data URI scramble (#16098)

* Removed unused method.

* No prefix for data uris.

* Added test to prevent regressions.

Co-authored-by: KN4CK3R <[email protected]>
@KN4CK3R KN4CK3R deleted the fix-data-uri branch June 10, 2021 12:04
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 10, 2021
* Removed unused method.

* No prefix for data uris.

* Added test to prevent regressions.
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
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.

Sanitizer exception for IMG SRC attribute not being applied
5 participants