Sanitize page template class. Props willmot. fixes #11722

git-svn-id: https://develop.svn.wordpress.org/trunk@12664 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-01-08 18:52:16 +00:00
parent f121906d10
commit 89784abc18

View File

@ -437,7 +437,7 @@ function get_body_class( $class = '' ) {
}
if ( is_page_template() ) {
$classes[] = 'page-template';
$classes[] = 'page-template-' . str_replace( '.php', '-php', get_post_meta( $pageID, '_wp_page_template', true ) );
$classes[] = 'page-template-' . sanitize_html_class( str_replace( '.', '-', get_post_meta( $pageID, '_wp_page_template', true ) ), '' );
}
} elseif ( is_search() ) {
if ( !empty($wp_query->posts) )