[wp-trac] [WordPress Trac] #39338: class-wp-hook.php - apply_filters() infinite loop

WordPress Trac noreply at wordpress.org
Tue Dec 20 09:37:13 UTC 2016


#39338: class-wp-hook.php - apply_filters() infinite loop
-------------------------------+------------------------------
 Reporter:  frettled           |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Plugins            |     Version:  4.7
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by dd32):

 Thanks for the extra details @frettled!

 I'm unable to reproduce this with the plugin mentioned, and can't find any
 code in any version of it which could trigger it (as far as I could tell).

 However with the additional error messages I was able to come up with some
 code which reproduces it, although any code doing something like this
 couldn't be expected to work..  I'm hoping it might help someone else see
 why this case is being triggered.

 {{{
 function test_func() {}
 add_action( 'test', 'test_func' );

 global $wp_filter;
 $wp_filter['test']->callbacks = 123;

 do_action( 'test' );
 }}}

 If you can check to see if `->callbacks` or `$wp_filter` is used within
 any custom plugins it could help explain what's happening here.

 @pento - I'm assuming `WP_Hool->callbacks` is only public for
 `remove_filter()`? or was there something else that it's used for?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39338#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list