Opened 5 years ago

Last modified 2 years ago

#7267 reopened defect (bug)

Infinite recursion in get_category_parents() and _children()

Reported by: tellyworth Owned by: anonymous
Priority: normal Milestone: Future Release
Component: General Version:
Severity: normal Keywords: has-patch irish-coffee
Cc:

Description

These two functions can get stuck in a recursion loop if there's an indirect category hierarchy loop like A -> B -> C -> A.

The patch keeps track of traversed IDs and prevents repetition - there's a name for the algorithm but it escapes me. It increases memory usage but probably not too much - certainly less than infinite recursion does.

Attachments (1)

prevent-category-looping-r8296.patch (1.8 KB) - added by tellyworth 5 years ago.

Download all attachments as: .zip

Change History (3)

comment:1   ryan5 years ago

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

(In [8299]) Prevent category looping. Props tellyworth. fixes #7267

  • Milestone changed from 2.6 to Future Release
  • Resolution fixed deleted
  • Status changed from closed to reopened

This should be able to leverage wp_check_term_hierarchy_for_loops() now.

Note: See TracTickets for help on using tickets.