From 853940ed63fb648699d29fb0947b6b088633d6c9 Mon Sep 17 00:00:00 2001 From: Boro Sitnikovski Date: Thu, 24 Oct 2024 15:52:48 +0200 Subject: [PATCH] Fix special chars display in SMP (#39756) * Fix special chars display in SMP The Site Management Panel may break when special chars are included in the blog's name (quotes, ampersands, etc.). This commit fixes that. * Add ENT_QUOTES * Changelog * Use wp_specialchars_decode instead --- .../packages/jetpack-mu-wpcom/changelog/fix-smp-special-chars | 4 ++++ .../wpcom-dashboard-widgets/wpcom-dashboard-widgets.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/fix-smp-special-chars diff --git a/projects/packages/jetpack-mu-wpcom/changelog/fix-smp-special-chars b/projects/packages/jetpack-mu-wpcom/changelog/fix-smp-special-chars new file mode 100644 index 0000000000000..0bfb660b10d0f --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/fix-smp-special-chars @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Site Management Panel: fix site name encoding display diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-dashboard-widgets.php b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-dashboard-widgets.php index c627f966f295a..5312a26f24cde 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-dashboard-widgets.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-dashboard-widgets/wpcom-dashboard-widgets.php @@ -48,7 +48,7 @@ function enqueue_wpcom_dashboard_widgets() { $data = wp_json_encode( array( - 'siteName' => get_bloginfo( 'name' ), + 'siteName' => wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ), 'siteDomain' => wp_parse_url( home_url(), PHP_URL_HOST ), 'siteIconUrl' => get_site_icon_url( 38 ), )