Changes between Initial Version and Version 2 of Ticket #62354
- Timestamp:
- 11/07/2024 02:48:02 PM (6 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #62354
- Property Keywords has-patch added
-
Property
Milestone
changed from
Awaiting Review
to6.7.1
-
Ticket #62354 – Description
initial v2 1 1 Testing 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: 2 2 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` 6 4 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.5 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&marks=845#L845 related code in fetch_feed] ) which might be empty in some cases. 8 6 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] ).7 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&marks=873-875#L873 related code in get_bloginfo] ). 10 8 11 9 IMHO, the `fetch_feed` function should use the `get_bloginfo( 'charset' )` over the unchecked option value.