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 sub block field permissions correctly #9296

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

JarrodMFlesch
Copy link
Contributor

@JarrodMFlesch JarrodMFlesch commented Nov 18, 2024

Fixes #9288

What?

When a block had a subfield named blocks, sanitization would throw an error.

Why?

An incorrect check for the key of "fields" would then attempt to pass data.blocks[key].fields aka data.blocks.fields.fields to the next call of areAllPermissionsTrue which would be undefined. Instead if the key is fields it should pass data.blocks[key].

How?

Remove the second .fields property accessor.

@JarrodMFlesch JarrodMFlesch merged commit 5503afd into main Nov 18, 2024
53 checks passed
@JarrodMFlesch JarrodMFlesch deleted the fix/sanitize-block-permissions branch November 18, 2024 15:47
Copy link

🚀 This is included in version v3.0.0-beta.135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Name conflict in blocks field
2 participants