Body Classes should be sanitised

Correctly add the current theme's name to the <body> classes. Previously, theme names that contain spaces and other strange characters would cause problems.
Also ensure that any other body classes that WooCommerce adds are also sanitised.
This commit is contained in:
James Collins 2012-04-19 17:14:48 +10:00
parent 727a4b1cf4
commit 9b9366c675
1 changed files with 2 additions and 2 deletions

View File

@ -424,7 +424,7 @@ class Woocommerce {
* Add body classes
**/
function wp_head() {
$this->add_body_class('theme-' . strtolower( get_current_theme() ));
$this->add_body_class('theme-' . get_current_theme() );
if ( is_woocommerce() ) $this->add_body_class('woocommerce');
@ -1354,7 +1354,7 @@ class Woocommerce {
/** Body Classes **********************************************************/
function add_body_class( $class ) {
$this->_body_classes[] = $class;
$this->_body_classes[] = sanitize_html_class( strtolower($class) );
}
function output_body_class( $classes ) {