Make WordPress Core

Changeset 59382


Ignore:
Timestamp:
11/11/2024 05:48:42 PM (3 weeks ago)
Author:
desrosj
Message:

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.

Props david.binda, davidbaumwald, SergeyBiryukov, sabernhardt, azaozz, peterwilsoncc.
Fixes #62354.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/feed.php

    r59241 r59382  
    843843
    844844    $feed->init();
    845     $feed->set_output_encoding( get_option( 'blog_charset' ) );
     845    $feed->set_output_encoding( get_bloginfo( 'charset' ) );
    846846
    847847    if ( $feed->error() ) {
Note: See TracChangeset for help on using the changeset viewer.