WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#18187 closed defect (bug) (duplicate)

Inconsistent behaviour for register_sidebar and is_active_sidebar

Reported by: nikolay.yordanov Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description

Part of the sidebar-related functions use sanitize_title() for the sidebar id, while others don't. For example, if I try to register a sidebar with an id like "Not The Very Best Sidebar ID" everything is fine and register_sidebar stores it under $wp_registered_sidebars['Not The Very Best Sidebar ID']. But when I use is_active_sidebar with the same id, it first passes the id through sanitize_title() and looks for the sidebar data in $wp_registered_sidebars['not-the-very-best-sidebar-id']

My patch adds sanitize_title() to the following functions: register_sidebar, unregister_sidebar and wp_sidebar_description.

Attachments (1)

sidebars_sanitize_title.diff (830 bytes) - added by nikolay.yordanov 3 years ago.

Download all attachments as: .zip

Change History (2)

comment:1 azaozz3 years ago

  • Component changed from General to Widgets
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version changed from 3.2.1 to 2.7

This is on the list for enhancements in 3.3 in somewhat expanded form. Also a duplicate of #11160.

Note: See TracTickets for help on using tickets.