From de5cecc69d450e9a254cf580f7d62936c93c9feb Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 8 Jan 2010 18:52:16 +0000 Subject: [PATCH] Sanitize page template class. Props willmot. fixes #11722 git-svn-id: http://svn.automattic.com/wordpress/trunk@12664 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 3c87ba884f..790abf1b58 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -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) )