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. git-svn-id: https://develop.svn.wordpress.org/trunk@45208 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b66077a1aa
commit
f83829ca4e
|
@ -43,12 +43,11 @@ do_action( 'rss_tag_pre', 'atom-comments' );
|
||||||
</title>
|
</title>
|
||||||
<subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle>
|
<subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle>
|
||||||
|
|
||||||
<updated>
|
<updated><?php // phpcs:ignore Squiz.PHP.EmbeddedPhp.ContentBeforeOpen,Squiz.PHP.EmbeddedPhp.ContentAfterOpen
|
||||||
<?php
|
|
||||||
$date = get_last_build_date();
|
$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' );
|
echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date, false ) : date( 'Y-m-d\TH:i:s\Z' );
|
||||||
?>
|
// phpcs:ignore Squiz.PHP.EmbeddedPhp.ContentAfterEnd
|
||||||
</updated>
|
?></updated>
|
||||||
|
|
||||||
<?php if ( is_singular() ) { ?>
|
<?php if ( is_singular() ) { ?>
|
||||||
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php comments_link_feed(); ?>" />
|
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php comments_link_feed(); ?>" />
|
||||||
|
|
|
@ -30,12 +30,11 @@ do_action( 'rss_tag_pre', 'atom' );
|
||||||
<title type="text"><?php wp_title_rss(); ?></title>
|
<title type="text"><?php wp_title_rss(); ?></title>
|
||||||
<subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle>
|
<subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle>
|
||||||
|
|
||||||
<updated>
|
<updated><?php // phpcs:ignore Squiz.PHP.EmbeddedPhp.ContentBeforeOpen,Squiz.PHP.EmbeddedPhp.ContentAfterOpen
|
||||||
<?php
|
|
||||||
$date = get_last_build_date();
|
$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' );
|
echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date, false ) : date( 'Y-m-d\TH:i:s\Z' );
|
||||||
?>
|
// phpcs:ignore Squiz.PHP.EmbeddedPhp.ContentAfterEnd
|
||||||
</updated>
|
?></updated>
|
||||||
|
|
||||||
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php bloginfo_rss( 'url' ); ?>" />
|
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php bloginfo_rss( 'url' ); ?>" />
|
||||||
<id><?php bloginfo( 'atom_url' ); ?></id>
|
<id><?php bloginfo( 'atom_url' ); ?></id>
|
||||||
|
|
Loading…
Reference in New Issue