Commit 0771fe28cd for wordpress.org
commit 0771fe28cd04e022ceda1f7697070b56e0e7f3e8
Author: isabel_brison <isabel_brison@git.wordpress.org>
Date: Fri Jan 23 05:57:34 2026 +0000
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.
Built from https://develop.svn.wordpress.org/trunk@61516
git-svn-id: http://core.svn.wordpress.org/trunk@60827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/style-engine/class-wp-style-engine-css-declarations.php b/wp-includes/style-engine/class-wp-style-engine-css-declarations.php
index fbcb54b73a..796ea86c20 100644
--- a/wp-includes/style-engine/class-wp-style-engine-css-declarations.php
+++ b/wp-includes/style-engine/class-wp-style-engine-css-declarations.php
@@ -59,6 +59,11 @@ class WP_Style_Engine_CSS_Declarations {
return $this;
}
+ // Bail early if value is not a string. Prevents fatal errors from malformed block markup.
+ if ( ! is_string( $value ) ) {
+ return $this;
+ }
+
// Trims the value. If empty, bail early.
$value = trim( $value );
if ( '' === $value ) {
diff --git a/wp-includes/version.php b/wp-includes/version.php
index ba8ca0a5af..0eadba3143 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.0-alpha-61515';
+$wp_version = '7.0-alpha-61516';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.