[wp-trac] [WordPress Trac] #62354: fetch_feed should use `get_bloginfo( 'charset' )` over `get_option( 'blog_charset' )` when setting the output encoding

WordPress Trac noreply at wordpress.org
Mon Nov 11 17:48:57 UTC 2024


#62354: fetch_feed should use `get_bloginfo( 'charset' )` over `get_option(
'blog_charset' )` when setting the output encoding
--------------------------------------+----------------------
 Reporter:  david.binda               |       Owner:  desrosj
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  6.7
Component:  Feeds                     |     Version:  trunk
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+----------------------
Changes (by desrosj):

 * owner:  (none) => desrosj
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"59382" 59382]:
 {{{
 #!CommitTicketReference repository="" revision="59382"
 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.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62354#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list