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

WordPress Trac noreply at wordpress.org
Wed Dec 28 11:41:14 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 needs-patch  |     Focuses:
-------------------------------------------+------------------------------

Comment (by dd32):

 Replying to [comment:12 frettled]:
 > Why not simply add a test at line 283 to fix the problem once and for
 all?
 >
 > I can understand the sentiment that you want plugin authors to fix their
 plugins, but you will ''never'' have complete control over plugin authors,
 only the core WP code. The fix belongs in core WP, not elsewhere.

 Honestly, because it doesn't actually fix the underlying problem.

 The change suggested simply papers over it, ignores that it ever happened.
 That value should never not be an array, if it is, something has broken
 somewhere, and we need to find it and fix it.
 It could mean that filters are not being applied correctly, or in the
 correct order under certain circumstances. Right now we have no idea what
 the actual implications of this issue are - other than an infinite loop,
 so far experienced by only two known people.

 Multiple people have looked at this and haven't been able to reproduce or
 otherwise determine how or why it's broken.

 The code I posted in [comment:4 comment#4] duplicated the issues, but
 wasn't a realistic thing that '''any''' plugin would ever have done,
 either deliberately, or accidentally. It also would have never worked
 under 4.6, and more than likely caused WordPress to explode then, so  It's
 much more likely to be a bug in one of our loops in `WP_Hook` somewhere.

 The WordPress filters and actions API is called thousands (sometimes tens
 of thousand) a page load, any small bugs there can have performance
 implications, or security implications if certain filters get bypassed
 accidentally, etc.

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


More information about the wp-trac mailing list