From 585354acbf22232b13bc2ecd4541a46187dd1be9 Mon Sep 17 00:00:00 2001 From: Douglas Johnson Date: Fri, 22 Sep 2023 10:43:32 -0400 Subject: [PATCH] Use sanitize_html_class for html classes --- .../class-block-coauthor-description.php | 2 +- php/blocks/block-coauthor-name/class-block-coauthor-name.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/php/blocks/block-coauthor-description/class-block-coauthor-description.php b/php/blocks/block-coauthor-description/class-block-coauthor-description.php index 3ac37894..f881d32f 100644 --- a/php/blocks/block-coauthor-description/class-block-coauthor-description.php +++ b/php/blocks/block-coauthor-description/class-block-coauthor-description.php @@ -81,7 +81,7 @@ public static function get_custom_block_wrapper_attributes( array $attributes ): } return array( - 'class' => $default['class'] . ' ' . esc_attr( "has-text-align-{$text_align}" ), + 'class' => $default['class'] . ' ' . sanitize_html_class( "has-text-align-{$text_align}" ), ); } } diff --git a/php/blocks/block-coauthor-name/class-block-coauthor-name.php b/php/blocks/block-coauthor-name/class-block-coauthor-name.php index efe71c35..da61c036 100644 --- a/php/blocks/block-coauthor-name/class-block-coauthor-name.php +++ b/php/blocks/block-coauthor-name/class-block-coauthor-name.php @@ -117,7 +117,7 @@ public static function get_custom_block_wrapper_attributes( array $attributes ): return array(); } return array( - 'class' => esc_attr( "has-text-align-{$text_align}" ), + 'class' => sanitize_html_class( "has-text-align-{$text_align}" ), ); } }