diff --git a/src/wp-includes/feed-atom-comments.php b/src/wp-includes/feed-atom-comments.php index 3bf0521574..49e5ca0764 100644 --- a/src/wp-includes/feed-atom-comments.php +++ b/src/wp-includes/feed-atom-comments.php @@ -43,8 +43,7 @@ do_action( 'rss_tag_pre', 'atom-comments' ); - - + diff --git a/src/wp-includes/feed-atom.php b/src/wp-includes/feed-atom.php index 16e9157b7f..bce41086be 100644 --- a/src/wp-includes/feed-atom.php +++ b/src/wp-includes/feed-atom.php @@ -30,8 +30,7 @@ do_action( 'rss_tag_pre', 'atom' ); <?php wp_title_rss(); ?> - - + diff --git a/src/wp-includes/feed-rdf.php b/src/wp-includes/feed-rdf.php index 708893245f..861425ae30 100644 --- a/src/wp-includes/feed-rdf.php +++ b/src/wp-includes/feed-rdf.php @@ -33,12 +33,7 @@ do_action( 'rss_tag_pre', 'rdf' ); <?php wp_title_rss(); ?> - - - + <?php wp_title_rss(); ?> - - - + http://backend.userland.com/rss092 diff --git a/src/wp-includes/feed-rss2-comments.php b/src/wp-includes/feed-rss2-comments.php index c736bebccd..f8ba016b23 100644 --- a/src/wp-includes/feed-rss2-comments.php +++ b/src/wp-includes/feed-rss2-comments.php @@ -49,12 +49,7 @@ do_action( 'rss_tag_pre', 'rss2-comments' ); - - - + " rel="self" type="application/rss+xml" /> - - - + have_posts() ) { @@ -670,16 +672,24 @@ function get_last_build_date() { } // Determine the maximum modified time. - $max_modified_time = max( $modified_times ); + $max_modified_time = max( + array_map( + function ( $time ) use ( $format ) { + return mysql2date( $format, $time, false ); + }, + $modified_times + ) + ); /** * Filters the date the last post or comment in the query was modified. * * @since 5.2.0 * - * @param string $max_modified_times Date the last post or comment was modified in the query. + * @param string $max_modified_time Date the last post or comment was modified in the query. + * @param string $format The date format requested in get_feed_build_date. */ - return apply_filters( 'get_last_build_date', $max_modified_time ); + return apply_filters( 'get_feed_build_date', $max_modified_time, $format ); } /** diff --git a/tests/phpunit/tests/feed/rss2.php b/tests/phpunit/tests/feed/rss2.php index 4b17ac747a..8263fde4dd 100644 --- a/tests/phpunit/tests/feed/rss2.php +++ b/tests/phpunit/tests/feed/rss2.php @@ -472,9 +472,9 @@ class Tests_Feeds_RSS2 extends WP_UnitTestCase { * * @ticket 4575 * - * @dataProvider data_test_get_last_build_date + * @dataProvider data_test_get_feed_build_date */ - public function test_get_last_build_date( $url, $element ) { + public function test_get_feed_build_date( $url, $element ) { $this->go_to( $url ); $feed = $this->do_rss2(); $xml = xml_to_array( $feed ); @@ -482,11 +482,11 @@ class Tests_Feeds_RSS2 extends WP_UnitTestCase { // Get the child element of . $rss = xml_find( $xml, $element ); $last_build_date = $rss[0]['child'][0]['child'][4]['content']; - $this->assertEquals( strtotime( get_last_build_date() ), strtotime( $last_build_date ) ); + $this->assertEquals( strtotime( get_feed_build_date( 'r' ) ), strtotime( $last_build_date ) ); } - public function data_test_get_last_build_date() { + public function data_test_get_feed_build_date() { return array( array( '/?feed=rss2', 'rss' ), array( '/?feed=commentsrss2', 'rss' ),