Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/25/2020 07:15:20 PM (4 years ago)
Author:
imath
Message:

Templates: avoid duplicate IDs into comment form nonce field

We now include the Activity ID to the id attribute of the input tag generated for the nonce field used into the Activity comment form. This makes sure to avoid duplicate IDs when multiple activities are displayed on the activity pages.

Props dcavins

Fixes #8004

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/template-tags.php

    r12703 r12735  
    25862586 * @param string $action The action to get the submit button for. Required.
    25872587 */
    2588 function bp_nouveau_submit_button( $action ) {
     2588function bp_nouveau_submit_button( $action, $object_id = 0 ) {
    25892589    $submit_data = bp_nouveau_get_submit_button( $action );
    25902590    if ( empty( $submit_data['attributes'] ) || empty( $submit_data['nonce'] ) ) {
     
    26202620        wp_nonce_field( $submit_data['nonce'] );
    26212621    } else {
     2622        if ( $object_id ) {
     2623            $submit_data['nonce_key'] .= '_' . (int) $object_id;
     2624        }
     2625
    26222626        wp_nonce_field( $submit_data['nonce'], $submit_data['nonce_key'] );
    26232627    }
Note: See TracChangeset for help on using the changeset viewer.