Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#23273 closed defect (bug) (duplicate)

function wp_nonce_field should randomize id attribute

Reported by: jay_freetailed's profile jay_freetailed Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Validation Keywords:
Focuses: Cc:


The wp_nonce_field function in wp-includes/functions.php should use a random seed for the id attribute of the field. In cases where there are pages or posts with multiple forms, each nonce hidden field has the same id attribute. This causes the w3c Markup Validation Service to site an error "Duplicate ID _wpnonce."

Another solution could be to simply omit the id attribute all together.

See code here

The function simply uses the name of the field as the id attribute.

Change History (1)

#1 @ocean90
11 years ago

  • Component changed from General to Validation
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 3.5 deleted

Duplicate of #23165.

Note: See TracTickets for help on using tickets.