From 883e20e3ddcf4dec21b211238fc19d2a397c9ed0 Mon Sep 17 00:00:00 2001 From: desrosj Date: Mon, 11 Nov 2024 17:50:17 +0000 Subject: [PATCH] Feeds: Avoid fatal error with empty `blog_charset` value. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the SimplePie library was updated to version `1.8.0` in [59141], an edge case has been discovered where a fatal error can encountered if the `blog_charset` option is missing or empty. In `fetch_feed()`, this option is retrieved using `get_option()` instead of `get_bloginfo( ‘charset’ )`. The latter will detect this scenario and apply a default value of `UTF-8` and is already used interchangeably throughout Core. This switches to `get_bloginfo( ‘charset’ )` instead to prevent this edge case. Props david.binda, davidbaumwald, SergeyBiryukov, sabernhardt, azaozz, peterwilsoncc. Fixes #62354. Built from https://develop.svn.wordpress.org/trunk@59382 git-svn-id: http://core.svn.wordpress.org/trunk@58768 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/feed.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 810abfee6f..8a6d256068 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -842,7 +842,7 @@ function fetch_feed( $url ) { do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) ); $feed->init(); - $feed->set_output_encoding( get_option( 'blog_charset' ) ); + $feed->set_output_encoding( get_bloginfo( 'charset' ) ); if ( $feed->error() ) { return new WP_Error( 'simplepie-error', $feed->error() ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 2313e7004b..2b2b519b56 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59380'; +$wp_version = '6.8-alpha-59382'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.