Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #62354


Ignore:
Timestamp:
11/07/2024 02:48:02 PM (6 months ago)
Author:
sabernhardt
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #62354

    • Property Keywords has-patch added
    • Property Milestone changed from Awaiting Review to 6.7.1
  • Ticket #62354 – Description

    initial v2  
    11Testing the SimplePie 1.8.0 which is part of the upcoming WordPress 6.7 release, I've run into some fatal errors on blogs which have the `blog_charset` option empty:
    22
    3 ```
    4 Fatal error: Uncaught ValueError: mb_convert_encoding(): Argument #2 ($to_encoding) must be a valid encoding, "" given in wp-includes/SimplePie/src/Misc.php:344
    5 ```
     3`Fatal error: Uncaught ValueError: mb_convert_encoding(): Argument #2 ($to_encoding) must be a valid encoding, "" given in wp-includes/SimplePie/src/Misc.php:344`
    64
    7 It turns out that the `fetch_feed` function is setting the SimplePie's output encoding by passing in the `get_option( 'blog_charset' )` ( [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/feed.php?rev=59241#L845 related code] ) which might be empty in some cases.
     5It turns out that the `fetch_feed` function is setting the SimplePie's output encoding by passing in the `get_option( 'blog_charset' )` ( [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/feed.php?rev=59241&marks=845#L845 related code in fetch_feed] ) which might be empty in some cases.
    86
    9 While I'm not sure how or why the option is empty, the `get_bloginfo( 'charset' )` accounts for such a case and outputs the default `UTF-8` encoding in such case ( [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/general-template.php?rev=59010#L873 related code] ).
     7While I'm not sure how or why the option is empty, the `get_bloginfo( 'charset' )` accounts for such a case and outputs the default `UTF-8` encoding in such case ( [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/general-template.php?rev=59010&marks=873-875#L873 related code in get_bloginfo] ).
    108
    119IMHO, the `fetch_feed` function should use the `get_bloginfo( 'charset' )` over the unchecked option value.