Hardening: Ensure the attributes of enclosures are correctly escaped in RSS and Atom feeds.
Merges [42260] to the 4.5 branch. Built from https://develop.svn.wordpress.org/branches/4.5@42282 git-svn-id: http://core.svn.wordpress.org/branches/4.5@42111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cc28f09509
commit
8511c84d2c
|
@ -475,7 +475,7 @@ function rss_enclosure() {
|
||||||
*
|
*
|
||||||
* @param string $html_link_tag The HTML link tag with a URI and other attributes.
|
* @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" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -509,7 +509,7 @@ function atom_enclosure() {
|
||||||
*
|
*
|
||||||
* @param string $html_link_tag The HTML link tag with a URI and other attributes.
|
* @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" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue