diff --git a/src/wp-includes/feed.php b/src/wp-includes/feed.php index 2333285d7b4bc..8a6d2560681f3 100644 --- a/src/wp-includes/feed.php +++ b/src/wp-includes/feed.php @@ -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_bloginfo(' charset' ) ); + $feed->set_output_encoding( get_bloginfo( 'charset' ) ); if ( $feed->error() ) { return new WP_Error( 'simplepie-error', $feed->error() ); diff --git a/tests/phpunit/tests/feed/fetchFeed.php b/tests/phpunit/tests/feed/fetchFeed.php index 4a994726b13b8..6ed807e4153f4 100644 --- a/tests/phpunit/tests/feed/fetchFeed.php +++ b/tests/phpunit/tests/feed/fetchFeed.php @@ -27,6 +27,8 @@ public function test_empty_charset_does_not_trigger_fatal_error() { foreach( $feed->get_items( 0, 1 ) as $item ) { $content = $item->get_content(); } + + $this->assertStringContainsString( 'Learn WordPress is a learning resource providing workshops, quizzes, courses, lesson plans, and discussion groups so that anyone, from beginners to advanced users, can learn to do more with WordPress.', $content ); } public function mocked_rss_response() {