Feeds: Avoid fatal error with empty blog_charset value.

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.

Reviewed by davidbaumwald.
Merges [59382] to the 6.7 branch.

Props david.binda, davidbaumwald, SergeyBiryukov, sabernhardt, azaozz, peterwilsoncc.
Fixes #62354.
Built from https://develop.svn.wordpress.org/branches/6.7@59383


git-svn-id: http://core.svn.wordpress.org/branches/6.7@58769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2024-11-11 17:55:14 +00:00
parent f924a35270
commit 1245f70570
2 changed files with 2 additions and 2 deletions

View File

@ -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() );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.7-RC4-59381';
$wp_version = '6.7-RC4-59383';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.