WordPress.org

Make WordPress Core

Ticket #11722: post-template.diff

File post-template.diff, 687 bytes (added by willmot, 5 years ago)

sanitize_html_class for page templates

  • Users/willmot/Sites/wptrunk/wp-includes/post-template.php

     
    437437                } 
    438438                if ( is_page_template() ) { 
    439439                        $classes[] = 'page-template'; 
    440                         $classes[] = 'page-template-' . str_replace( '.php', '-php', get_post_meta( $pageID, '_wp_page_template', true ) ); 
     440                        $classes[] = 'page-template-' . sanitize_html_class( get_post_meta( $pageID, '_wp_page_template', true ), '' ); 
    441441                } 
    442442        } elseif ( is_search() ) { 
    443443                if ( !empty($wp_query->posts) )