Skip to content
Permalink
Browse files

Hardening: Ensure the attributes of enclosures are correctly escaped …

…in RSS and Atom feeds.

Built from https://develop.svn.wordpress.org/trunk@42260


git-svn-id: http://core.svn.wordpress.org/trunk@42089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
johnbillion committed Nov 29, 2017
1 parent 3713ac5 commit f1de7e42df29395c3314bf85bff3d1f4f90541de
Showing with 3 additions and 3 deletions.
  1. +2 −2 wp-includes/feed.php
  2. +1 −1 wp-includes/version.php
@@ -476,7 +476,7 @@ function rss_enclosure() {
*
* @param string $html_link_tag The HTML link tag with a URI and other attributes.
*/
echo apply_filters( 'rss_enclosure', '<enclosure url="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" length="' . trim( $enclosure[1] ) . '" type="' . $type . '" />' . "\n" );
echo apply_filters( 'rss_enclosure', '<enclosure url="' . esc_url( trim( $enclosure[0] ) ) . '" length="' . absint( trim( $enclosure[1] ) ) . '" type="' . esc_attr( $type ) . '" />' . "\n" );
}
}
}
@@ -510,7 +510,7 @@ function atom_enclosure() {
*
* @param string $html_link_tag The HTML link tag with a URI and other attributes.
*/
echo apply_filters( 'atom_enclosure', '<link href="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" rel="enclosure" length="' . trim( $enclosure[1] ) . '" type="' . trim( $enclosure[2] ) . '" />' . "\n" );
echo apply_filters( 'atom_enclosure', '<link href="' . esc_url( trim( $enclosure[0] ) ) . '" rel="enclosure" length="' . absint( trim( $enclosure[1] ) ) . '" type="' . esc_attr( trim( $enclosure[2] ) ) . '" />' . "\n" );
}
}
}
@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42259';
$wp_version = '5.0-alpha-42260';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 comments on commit f1de7e4

Please sign in to comment.
You can’t perform that action at this time.