WordPress.org

Make WordPress Core

Ticket #16773: 16773.diff

File 16773.diff, 834 bytes (added by solarissmoke, 3 years ago)
  • wp-includes/widgets.php

     
    9191         *       - height: currently not used but may be needed in the future 
    9292         */ 
    9393        function __construct( $id_base = false, $name, $widget_options = array(), $control_options = array() ) { 
    94                 $this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', strtolower(get_class($this)) ) : strtolower($id_base); 
     94                $this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', sanitize_key( get_class( $this ) ) ) : sanitize_key( $id_base ); 
    9595                $this->name = $name; 
    9696                $this->option_name = 'widget_' . $this->id_base; 
    9797                $this->widget_options = wp_parse_args( $widget_options, array('classname' => $this->option_name) );