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 sanitize media #12781

Merged
merged 1 commit into from Mar 8, 2022
Merged

Fix sanitize media #12781

merged 1 commit into from Mar 8, 2022

Conversation

alexandrebodin
Copy link
Member

What does it do?

Fix bug in sanitize function for medias

Why is it needed?

Redacted for security reasons.

How to test it?

DM if you need instruction

@alexandrebodin alexandrebodin added source: core:strapi Source is core/strapi package pr: security This PR is security issue labels Mar 8, 2022
@alexandrebodin alexandrebodin added this to the 4.1.3 milestone Mar 8, 2022
@codecov
Copy link

codecov bot commented Mar 8, 2022

Codecov Report

Merging #12781 (8173a8f) into master (af7c3d5) will decrease coverage by 0.03%.
The diff coverage is 20.00%.

❗ Current head 8173a8f differs from pull request most recent head 6a9db23. Consider uploading reports for the commit 6a9db23 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12781      +/-   ##
==========================================
- Coverage   47.63%   47.60%   -0.04%     
==========================================
  Files         228      228              
  Lines        8515     8525      +10     
  Branches     1898     1902       +4     
==========================================
+ Hits         4056     4058       +2     
- Misses       3665     3672       +7     
- Partials      794      795       +1     
Flag Coverage Δ
front ∅ <ø> (∅)
unit 47.60% <20.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...b/sanitize/visitors/remove-restricted-relations.js 9.09% <ø> (ø)
packages/core/utils/lib/traverse-entity.js 48.33% <20.00%> (-5.67%) ⬇️

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 af7c3d5...6a9db23. Read the comment docs.

derrickmehaffy
derrickmehaffy previously approved these changes Mar 8, 2022
Copy link
Member

@derrickmehaffy derrickmehaffy left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@Convly Convly left a comment

Choose a reason for hiding this comment

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

LGTM,
On a side note, I think we should prefer using internal services instead of a content API call when dealing with fixtures (such as the createFile). Here it's not an issue since we only care about the file ID, but it could have an impact when manipulating regular entities that have middlewares/policies or even specific validations. WDYT?

Copy link
Member

@derrickmehaffy derrickmehaffy left a comment

Choose a reason for hiding this comment

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

LGTM

@derrickmehaffy derrickmehaffy merged commit fc086f2 into master Mar 8, 2022
@derrickmehaffy derrickmehaffy deleted the hotfix/sanitize-medias branch March 8, 2022 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: security This PR is security issue source: core:strapi Source is core/strapi package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants