mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 11:14:36 +00:00
Themes: Add additional later escaping to post_class() and body_class() functions.
Additionally, this adds a few tests to test output. Fixes #20009. Props mfields, scribu, azaozz, obenland, dd32, nacin, jrf, jdgrimes, garyj, whyisjake. git-svn-id: https://develop.svn.wordpress.org/trunk@48060 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -454,7 +454,7 @@ function has_excerpt( $post = 0 ) {
|
||||
*/
|
||||
function post_class( $class = '', $post_id = null ) {
|
||||
// Separates classes with a single space, collates classes for post DIV.
|
||||
echo 'class="' . join( ' ', get_post_class( $class, $post_id ) ) . '"';
|
||||
echo 'class="' . esc_attr( join( ' ', get_post_class( $class, $post_id ) ) ) . '"';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -590,7 +590,7 @@ function get_post_class( $class = '', $post_id = null ) {
|
||||
*/
|
||||
function body_class( $class = '' ) {
|
||||
// Separates class names with a single space, collates class names for body element.
|
||||
echo 'class="' . join( ' ', get_body_class( $class ) ) . '"';
|
||||
echo 'class="' . esc_attr( join( ' ', get_body_class( $class ) ) ) . '"';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user