From 26bb9fde3db1ace313356a9ede87e8343be15974 Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Thu, 20 Jan 2022 09:17:43 +0000 Subject: [PATCH] Administration: Properly handle HTML entities in the News & Events dashboard widget. This change adds support for various HTML entities in the News & Events dashboard widget. Props nickciske, kpegoraro, iandunn, shedonist, sayedulsayem, sabernhardt, audrasjb, SergeyBiryukov, ocean90. Fixes #41208. git-svn-id: https://develop.svn.wordpress.org/trunk@52608 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-community-events.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-admin/includes/class-wp-community-events.php b/src/wp-admin/includes/class-wp-community-events.php index cf995eeac8..3f43f8d1db 100644 --- a/src/wp-admin/includes/class-wp-community-events.php +++ b/src/wp-admin/includes/class-wp-community-events.php @@ -453,6 +453,7 @@ class WP_Community_Events { * @since 4.8.0 * @since 4.9.7 Stick a WordCamp to the final list. * @since 5.5.2 Accepts and returns only the events, rather than an entire HTTP response. + * @since 6.0.0 Decode HTML entities from the event title. * * @param array $events The events that will be prepared. * @return array The response body with events trimmed. @@ -468,6 +469,9 @@ class WP_Community_Events { $end_time = (int) $event['end_unix_timestamp']; if ( time() < $end_time ) { + // Decode HTML entities from the event title. + $event['title'] = html_entity_decode( $event['title'], ENT_QUOTES, 'UTF-8' ); + array_push( $future_events, $event ); } }