Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#23273 closed defect (bug) (duplicate)

function wp_nonce_field should randomize id attribute

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

Description

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 ​http://core.trac.wordpress.org/browser/tags/3.5/wp-includes/functions.php

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

Change History (1)

#1 @ocean90
14 years ago

  • Component General → Validation
  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → closed
  • Version 3.5

Duplicate of #23165.

Note: See TracTickets for help on using tickets.