Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#22423 closed enhancement (fixed)

Argument parameter for wp_nonce_url

Reported by: matthewruddy's profile MatthewRuddy Owned by: nacin's profile nacin
Milestone: 3.6 Priority: normal
Severity: trivial Version: 3.4.2
Component: Security Keywords: has-patch commit
Focuses: Cc:

Description

The wp_nonce_url function in includes/functions.php doesn't allow the user to set the nonce argument name, unlike wp_nonce_field. Slight inconvenience when trying to attach different nonces to different URLs. Don't see the harm in adding an optional parameter for the argument name to the wp_nonce_url function. Modified functions.php file attached.

Attachments (3)

functions.php (115.4 KB) - added by MatthewRuddy 12 years ago.
Said modification to wp-includes/functions.php file
functions.diff (666 bytes) - added by MatthewRuddy 12 years ago.
22423.diff (950 bytes) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (12)

@MatthewRuddy
12 years ago

Said modification to wp-includes/functions.php file

#1 @SergeyBiryukov
12 years ago

  • Keywords needs-patch added; has-patch removed

Could you provide an actual patch, rather than the entire file?

Take a look at http://make.wordpress.org/core/handbook/submitting-a-patch/.

#2 @MatthewRuddy
12 years ago

My apologies!

#3 @juliobox
12 years ago

  • Cc juliobosk@… added

Hello, i was wondering why we can not change this, and this trac exists.
So, can we add this in 3.6 now ? The patch seems correct for me.
Thank you

#4 @rmccue
12 years ago

  • Keywords has-patch commit added; 2nd-opinion needs-patch removed

+1. Seems like this never got marked with the correct keywords, so it probably got missed.

New patch looks good.

#5 @MatthewRuddy
12 years ago

Sorry guys, new to this! Feel free to change any mistakes I've made.

#6 @SergeyBiryukov
12 years ago

$arg should probably be $name, for consistency with wp_nonce_field().

#7 @SergeyBiryukov
12 years ago

  • Type changed from defect (bug) to enhancement

#8 @SergeyBiryukov
12 years ago

  • Milestone changed from Awaiting Review to 3.6

#9 @nacin
12 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 23519:

Allow nonce name to be passed to wp_nonce_url(), as allowed by wp_nonce_field(). props MatthewRuddy, fixes #22423.

Note: See TracTickets for help on using tickets.