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

Update: Improve footnotes sanitisation by removing unrequired keys. #55305

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

jorgefilipecosta
Copy link
Member

This PR enhances the current footnotes sanitisation by adding logic that parses the json object and removes all the keys besides content and id. This makes sure for third-party developers that using other keys is not possible. Currently, they can use other keys for their own purposes which may break things in the future.

Testing

  • I added some footnotes and verified they still work as expected.

@jorgefilipecosta jorgefilipecosta added the [Type] Enhancement A suggestion for improvement. label Oct 12, 2023
@github-actions
Copy link

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/blocks.php

lib/blocks.php Outdated Show resolved Hide resolved
Co-authored-by: George Mamadashvili <[email protected]>
@jorgefilipecosta jorgefilipecosta merged commit 01876a8 into trunk Oct 12, 2023
48 checks passed
@jorgefilipecosta jorgefilipecosta deleted the update/improve-footnotes-santization branch October 12, 2023 13:28
@github-actions github-actions bot added this to the Gutenberg 16.9 milestone Oct 12, 2023
@getdave getdave added the Needs PHP backport Needs PHP backport to Core label Jan 23, 2024
@getdave
Copy link
Contributor

getdave commented Jan 23, 2024

@jorgefilipecosta I believe this will require a backport PR for WP 6.5.

@youknowriad
Copy link
Contributor

This is already in Core.

@youknowriad youknowriad removed the Needs PHP backport Needs PHP backport to Core label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants