Feeds: Remove whitespace from `<updated>` elements in Atom feeds.

Per Atom format's RFC, there must not be any whitespace in a Date construct or in any IRI.

Props josephwa.
Fixes #46922.
Built from https://develop.svn.wordpress.org/trunk@45208


git-svn-id: http://core.svn.wordpress.org/trunk@45017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-04-16 00:46:51 +00:00
parent 6efa2cd724
commit f25f241573
3 changed files with 7 additions and 9 deletions

View File

@ -43,12 +43,11 @@ do_action( 'rss_tag_pre', 'atom-comments' );
</title>
<subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle>
<updated>
<?php
<updated><?php // phpcs:ignore Squiz.PHP.EmbeddedPhp.ContentBeforeOpen,Squiz.PHP.EmbeddedPhp.ContentAfterOpen
$date = get_last_build_date();
echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date, false ) : date( 'Y-m-d\TH:i:s\Z' );
?>
</updated>
// phpcs:ignore Squiz.PHP.EmbeddedPhp.ContentAfterEnd
?></updated>
<?php if ( is_singular() ) { ?>
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php comments_link_feed(); ?>" />

View File

@ -30,12 +30,11 @@ do_action( 'rss_tag_pre', 'atom' );
<title type="text"><?php wp_title_rss(); ?></title>
<subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle>
<updated>
<?php
<updated><?php // phpcs:ignore Squiz.PHP.EmbeddedPhp.ContentBeforeOpen,Squiz.PHP.EmbeddedPhp.ContentAfterOpen
$date = get_last_build_date();
echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date, false ) : date( 'Y-m-d\TH:i:s\Z' );
?>
</updated>
// phpcs:ignore Squiz.PHP.EmbeddedPhp.ContentAfterEnd
?></updated>
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php bloginfo_rss( 'url' ); ?>" />
<id><?php bloginfo( 'atom_url' ); ?></id>

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.2-beta3-45207';
$wp_version = '5.2-beta3-45208';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.