Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#28810 closed defect (bug) (fixed)

is_active_widget() should skip orphaned widgets

Reported by: ninos-ego's profile Ninos Ego Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.0 Priority: normal
Severity: normal Version: 2.8
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description

The function is_active_widget() should also skip orphaned widgets. Orphaned widgets are also inactive widgets.

Attachments (2)

widgets.php.patch (562 bytes) - added by Ninos Ego 11 years ago.
widgets.php.2.patch (563 bytes) - added by Ninos Ego 11 years ago.
substr instead of strpos

Download all attachments as: .zip

Change History (8)

#1 @Ninos Ego
11 years ago

  • Keywords has-patch added

#2 @Ninos Ego
11 years ago

  • Severity changed from normal to major

#3 @westonruter
11 years ago

  • Version changed from trunk to 2.8

Yeah, this makes sense. Minor points: we should use triple-equals, and substr as used elsewhere to check for orphaned_widgets:

( 'wp_inactive_widgets' === $sidebar || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) )

Why was the severity changed to major?

#4 @SergeyBiryukov
11 years ago

  • Milestone changed from Awaiting Review to 4.0
  • Severity changed from major to normal

@Ninos Ego
11 years ago

substr instead of strpos

#5 @Ninos Ego
11 years ago

Sry because of the severity, it was a mistake. I've uploaded the ne patch. Should be ok now.

#6 @SergeyBiryukov
11 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 29064:

is_active_widget() should skip orphaned widgets.

props Ninos Ego.
fixes #28810.

Note: See TracTickets for help on using tickets.