Skip to:
Content

BuddyPress.org

Opened 11 months ago

Last modified 11 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: Up Next Priority: normal
Severity: normal Version: 3.0.0
Component: Activity Keywords: has-patch
Cc: dcavins

Description

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 11 months ago.
Customize IDs of activity comment form nonce inputs.

Download all attachments as: .zip

Change History (2)

@dcavins
11 months ago

Customize IDs of activity comment form nonce inputs.

#1 @DJPaul
11 months ago

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