Skip to content

WP_Theme_JSON: deprecate is_safe_css_declaration() and replace with is_safe() #73224

Closed
ramonjd wants to merge 1 commit intotrunkfrom
update/move-is_safe_css_declaration-to-style-engine
Closed

WP_Theme_JSON: deprecate is_safe_css_declaration() and replace with is_safe() #73224
ramonjd wants to merge 1 commit intotrunkfrom
update/move-is_safe_css_declaration-to-style-engine

Conversation

@ramonjd
Copy link
Member

@ramonjd ramonjd commented Nov 13, 2025

WIP

Part of #65728

Similar to
#73117

Refactor CSS declaration safety checks to use WP_Style_Engine_CSS_Declarations_Gutenberg::is_safe() method

  • Replaced static::is_safe_css_declaration() calls with the new is_safe() method for improved safety checks.
  • Updated related tests to validate the new method's functionality and edge cases.
  • Marked the old is_safe_css_declaration() method as deprecated.

What?

Closes

Why?

How?

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

Before After

…larations_Gutenberg::is_safe() method

- Replaced static::is_safe_css_declaration() calls with the new is_safe() method for improved safety checks.
- Updated related tests to validate the new method's functionality and edge cases.
- Marked the old is_safe_css_declaration() method as deprecated.
@ramonjd ramonjd changed the title WP_Theme_JSON: deprecate is_safe_css_declaration() and replace with s_safe() WP_Theme_JSON: deprecate is_safe_css_declaration() and replace with is_safe() Nov 23, 2025
@ramonjd
Copy link
Member Author

ramonjd commented Mar 11, 2026

Going back to the drawing board on these changes, I think a broader CSS validation/sanitization strategy is required.

@ramonjd ramonjd closed this Mar 11, 2026
@ramonjd ramonjd deleted the update/move-is_safe_css_declaration-to-style-engine branch March 11, 2026 06:26
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