WordPress.org

Make WordPress Core

Ticket #18187: sidebars_sanitize_title.diff

File sidebars_sanitize_title.diff, 830 bytes (added by nikolay.yordanov, 7 years ago)
  • wp-includes/widgets.php

     
    554554        );
    555555
    556556        $sidebar = wp_parse_args( $args, $defaults );
     557       
     558        $sidebar['id'] = sanitize_title($sidebar['id']);
    557559
    558560        $wp_registered_sidebars[$sidebar['id']] = $sidebar;
    559561
     
    576578function unregister_sidebar( $name ) {
    577579        global $wp_registered_sidebars;
    578580
     581        $name = sanitize_title($name);
     582       
    579583        if ( isset( $wp_registered_sidebars[$name] ) )
    580584                unset( $wp_registered_sidebars[$name] );
    581585}
     
    675679                return;
    676680
    677681        global $wp_registered_sidebars;
     682       
     683        $id = sanitize_title($id);
    678684
    679685        if ( isset($wp_registered_sidebars[$id]['description']) )
    680686                return esc_html( $wp_registered_sidebars[$id]['description'] );