Ticket #47564: fix_customizer_nav_menu_freeze.diff
File fix_customizer_nav_menu_freeze.diff, 835 bytes (added by , 5 years ago) |
---|
-
src/js/_enqueues/wp/customize/nav-menus.js
1876 1876 if ( ! setting ) { 1877 1877 return 0; 1878 1878 } 1879 while ( setting && setting.menu_item_parent ) { 1879 // Protect against bad recursive navigation menu data causing causing browser to freeze. 1880 var seen_parents = {}; 1881 while ( setting && setting.menu_item_parent && ! seen_parents[setting.menu_item_parent] ) { 1880 1882 depth += 1; 1881 1883 control = api.control( 'nav_menu_item[' + setting.menu_item_parent + ']' ); 1882 1884 if ( ! control ) { 1883 1885 break; 1884 1886 } 1887 seen_parents[setting.menu_item_parent] = setting; 1885 1888 setting = control.setting(); 1886 1889 } 1887 1890 return depth;