Make WordPress Core

Opened 11 months ago

Last modified 3 weeks ago

#24461 new defect (bug)

_get_term_children can loop forever (well until it times out) if there is a loop in the hierarchy

Reported by: westi Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.6
Component: Taxonomy Keywords: needs-patch
Focuses: Cc:


_get_term_children call's itself recursively to build the array of children. If there is for some reason a loop in the hierarchy it gets stuck and loops for ever trying to build the list of descendents.

Seeing as we fetch the whole hierarchy with _get_term_hierarchy we can probably just use that to build an array of descendents without recursion.

Otherwise we should leverage our loop detection code to find and maybe break loops.

Change History (6)

comment:2 markjaquith9 months ago

  • Milestone changed from Awaiting Review to Future Release

comment:3 rmarks9 months ago

Can someone point me toward the loop detection code? I'm willing to write a patch.

comment:4 rmarks9 months ago

  • Cc rmarks@… added

comment:6 ircbot3 weeks ago

This ticket was mentioned in IRC in #wordpress-dev by SergeyBiryukov. View the logs.

Note: See TracTickets for help on using tickets.