Skip to:

Opened 21 months ago

Last modified 3 months ago

#8004 new defect (bug)

Multiple comment forms on activity stream lead to duplicated _wpnonce_new_activity_comment input ids

Reported by: dcavins Owned by:
Milestone: 7.0.0 Priority: normal
Severity: normal Version: 3.0.0
Component: Activity Keywords: has-patch
Cc: dcavins


In the activity stream, we generate a comment form for each activity item that could be commented upon. In both BP Legacy and BP Nouveau, we add a nonce to each <form>, using the same key , _wpnonce_new_activity_comment, which results in an input like <input type="hidden" id="_wpnonce_new_activity_comment" name="_wpnonce_new_activity_comment" value="d34c5f9ffe">.

To make the IDs of these inputs unique (even though the values aren't), I've added a new function to generate nonces with customizable IDs, and changed the form-submit listener logic in Legacy and Nouveau so that the correct input is selected. (We could also change the selectors to find the input by name, like jQuery('input[name="_wpnonce_new_activity_comment"]') if that seems simpler. )

Thanks for your comments!

Attachments (1)

8004.1.diff (7.0 KB) - added by dcavins 21 months ago.
Customize IDs of activity comment form nonce inputs.

Download all attachments as: .zip

Change History (3)

21 months ago

Customize IDs of activity comment form nonce inputs.

#1 @DJPaul
21 months ago

  • Milestone changed from Awaiting Review to Up Next

#2 @imath
3 months ago

  • Milestone changed from Up Next to 7.0.0
Note: See TracTickets for help on using tickets.