Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#42274 new defect (bug)

preview_sidebars_widgets unsetting $sidebars_widgets['array_version'] without check

Reported by: darrencoutts Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.9
Component: Customize Keywords: reporter-feedback
Focuses: Cc:
PR Number:

Description (last modified by westonruter)

WP_Customize_Widgets::preview_sidebars_widgets() unsets $sidebars_widgets['array_version'] without checking that it is ever set in the first place.

Granted that it should be, however if a developer wants to remove all widgets from their site, it is possible that they will clear them from a database, a database may be corrupted, or a plugin/theme sets this option by mistake.

Suggest that this should have a conditional check to ensure that $sidebars_widgetsarray_version? is actually set and also ensure that this function always returns an array, even if the database has been emptied.

Change History (2)

#1 @westonruter
2 years ago

  • Description modified (diff)
  • Keywords reporter-feedback added

@darrencoutts thanks for the report. Is this related to #27965?

Would you also clarify what you mean by emptying the database? Steps to reproduce the problem would be helpful.

#2 @westonruter
2 years ago

  • Version changed from trunk to 3.9
Note: See TracTickets for help on using tickets.