Opened 11 years ago
Closed 11 years ago
#28009 closed defect (bug) (fixed)
Recent Posts widget breaks ob stack
Reported by: | m_i_n | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 3.9.1 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | Widgets | Keywords: | has-patch commit fixed-major |
Focuses: | administration | Cc: |
Description
Please have a look at the following part of "Recent Posts" widget code (default-widgets.php, from line 731):
if ( ! $this->is_preview() ) { $cache[ $args['widget_id'] ] = ob_get_flush(); wp_cache_set( 'widget_recent_posts', $cache, 'widget' ); } else { ob_flush(); }
If you're not in is_preview(), output buffer is returned to var, flushed, and turns output buffering off (it's OK). However, in other case, buffer in not returned to var, flushed (it's OK until now), but output buffering is not turned off (it should be ob_end_flush instead of ob_flush). It breaks ob stack.
The bug is noticeable in Appearance / Customize, if a theme uses output buffering on the dynamic_sidebar() function, and the widget is active.
Attachments (1)
Change History (7)
Note: See
TracTickets for help on using
tickets.
Hello m_i_n, thanks for the report.
From the PHP docs:
So I agree, we should use ob_end_flush() here.