Skip to content

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

Closed
ramonjd wants to merge 2 commits intoWordPress:trunkfrom
ramonjd:update/theme-json-get-style-nodes-check-for-element
Closed

WP_Theme_JSON Elements: check value and whitelist before building style nodes#3138
ramonjd wants to merge 2 commits intoWordPress:trunkfrom
ramonjd:update/theme-json-get-style-nodes-check-for-element

Conversation

@ramonjd
Copy link
Copy Markdown
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