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

WP_Theme_JSON Elements: check value and whitelist before building style nodes #3138

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Aug 26, 2022

What?

In WP_Theme_JSON::get_style_nodes()

  • Check for elements values in theme.json before creating a node
  • Check for element name in the whitelist before creating a node

Why?

If an element does not exist in the static::ELEMENTS whitelist, PHP will complain about Notice: Undefined index.

Gutenberg PR: WordPress/gutenberg#43622

Trac ticket:

@ramonjd ramonjd changed the title Check for elements values and element names in whitelist WP_Theme_JSON Elements: check value and whitelist before building style nodes Aug 26, 2022
... to check if $element key exists in const ELEMENTS
@ramonjd ramonjd closed this Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant