Make WordPress Core

Opened 17 years ago

Closed 12 years ago

#7267 closed defect (bug) (invalid)

Infinite recursion in get_category_parents() and _children()

Reported by: tellyworth's profile tellyworth Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch irish-coffee
Focuses: 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 17 years ago.

Download all attachments as: .zip

Change History (5)

#1 @ryan
17 years ago

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

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

#2 @nacin
14 years ago

  • 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.

#3 @iseulde
12 years ago

  • Component changed from General to Taxonomy

#4 @wonderboymusic
12 years ago

  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from reopened to closed

These funcs have been deprecated in the 3 years since this patch was last looked at

Note: See TracTickets for help on using tickets.