Make WordPress Core

Opened 20 months ago

Last modified 20 months ago

#62925 accepted defect (bug)

Non-unique names for inputs in nav-menu

Reported by: kkmuffme Owned by: joedolson
Priority: normal Milestone: Awaiting Review
Component: Menus Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

/wp-admin/nav-menus.php

e.g. in the

<form id="nav-menu-meta" class="nav-menu-meta" method="post" enctype="multipart/form-data">

If there are custom menus (e.g. WooCommerce) but possibly also only with native ones, it's possible that there are multiple different input with identical name= which will cause issues on form submit/processing.

e.g.

<input type="hidden" class="menu-item-title" name="menu-item[-1][menu-item-title]" value="Some Text"/>

I have multiple elements in the navigation that all have "menu-item[-1][menu-item-title]" as name (starting from -1 all the way up to -133 which is the number of elements in the navigation)
Also affects other elements like menu-item[-1][menu-item-url],...

Change History (3)

This ticket was mentioned in ​PR #8296 on ​WordPress/wordpress-develop by ​@snehapatil02.


20 months ago
#1

  • Keywords has-patch added

This PR fixes an issue where custom menu items in the WordPress navigation menu were being generated with duplicate input names, causing potential form submission and processing issues.

Trac ticket: https://core.trac.wordpress.org/ticket/62925

#2 @joedolson
20 months ago

  • Owner set to joedolson
  • Status new → accepted

#3 @joedolson
20 months ago

  • Severity major → normal
Note: See TracTickets for help on using tickets.