Skip to:
Content

BuddyPress.org

Changeset 12378 for trunk


Ignore:
Timestamp:
04/25/2019 02:37:12 PM (7 years ago)
Author:
boonebgorges
Message:

Nouveau: Improved escaping for activity IDs.

Props whyisjake.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/js/buddypress-activity.js

    r12348 r12378  
    346346                        // Prepend a link to display all
    347347                        if ( ! i ) {
    348                             $( item ).before( '<li class="show-all"><button class="text-button" type="button" data-bp-show-comments-id="#' + activity_item.prop( 'id' ) + '/show-all/"><span class="icon dashicons dashicons-visibility" aria-hidden="true"></span> ' + BP_Nouveau.show_x_comments.replace( '%d', comment_count ) + '</button></li>' );
     348                            var activity_id = activity_item.data( 'bpActivityId' );
     349                            if ( 'undefined' !== typeof activity_id ) {
     350                                activity_id = parseInt( activity_id, 10 );
     351                                $( item ).before( '<li class="show-all"><button class="text-button" type="button" data-bp-show-comments-id="#activity-' + activity_id + '/show-all/"><span class="icon dashicons dashicons-visibility" aria-hidden="true"></span> ' + BP_Nouveau.show_x_comments.replace( '%d', comment_count ) + '</button></li>' );
     352                            }
    349353                        }
    350354                    }
Note: See TracChangeset for help on using the changeset viewer.