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

WordPress Trac noreply at wordpress.org
Fri Nov 18 00:49:39 UTC 2022


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

Comment (by azaozz):

 Unfortunately I couldn't reproduce this either (tried pretty hard).

 > It's still unclear to me how exactly it happens (I had no luck
 attempting to reproduce it), but it feels like it might be beneficial to
 have some more safe-guards
 > ...
 > I think core code should protect against infinite loops due to
 bad/malformed/unexpected data

 Yes, thinking the same. Since the bad/incorrect data is in the wild, there
 should be safeguards in `wp_nav_menu()` (as the current patch). Would also
 be nice to validate/verify the patent ID when adding `menu_item_parent`
 meta, although not sure what should be the response if the ID is invalid.
 If this is reproduced, seems it would be easier to decide what to do (i.e.
 is this only happening for top level menu items, etc.).

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


More information about the wp-trac mailing list