Make WordPress Core


Ignore:
Timestamp:
01/23/2026 05:56:40 AM (9 months ago)
Author:
isabel_brison
Message:

Editor: guard against non-string values in style engine.

Checks that the value passed to add_declaration is a string to prevent fatal errors due to malformed block attributes.

Props andrewserong.
Fixes #64545.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/style-engine/class-wp-style-engine-css-declarations.php

    r55819 r61516  
    5757                // Bails early if the property is empty.
    5858                if ( empty( $property ) ) {
     59                        return $this;
     60                }
     61
     62                // Bail early if value is not a string. Prevents fatal errors from malformed block markup.
     63                if ( ! is_string( $value ) ) {
    5964                        return $this;
    6065                }
Note: See TracChangeset for help on using the changeset viewer.