[wp-trac] [WordPress Trac] #56926: Infinite loop in wp_nav_menu

WordPress Trac noreply at wordpress.org
Mon Nov 14 22:46:12 UTC 2022


#56926: Infinite loop in wp_nav_menu
-------------------------------------------------+-------------------------
 Reporter:  david.binda                          |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Menus                                |     Version:  6.1
 Severity:  normal                               |  Resolution:
 Keywords:  reporter-feedback has-patch has-     |     Focuses:
  unit-tests needs-refresh                       |
-------------------------------------------------+-------------------------

Comment (by jmdodd):

 We've seen several sites get into infinite loops based on the values in
 the database when wp_nav_menu() is called -- to be clear, this isn't
 thousands of sites (that we know of). Because of the nature of the
 regression, these sites generally show up after exhausting server
 resources. Those that are failing for this specific reason have results
 for the following query:

 {{{
 SELECT * FROM wp_postmeta WHERE meta_key = '_menu_item_menu_item_parent'
 AND meta_value = post_id;
 }}}

 One trend is that the nav_menu_items found with this query seem to be
 older, with post_date_gmts of 2017-08-05 14:29:05, 2019-12-12 04:11:41,
 and 2016-11-02 19:47:47.

 In general, I think core code should protect against infinite loops due to
 bad/malformed/unexpected data whenever possible because it is a minor
 inconvenience compared to the performance consequences of a loop.

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


More information about the wp-trac mailing list