Skip to:
Content

BuddyPress.org


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

Activity: Improved capability checks when processing reply POSTs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/activity/ajax.php

    r12365 r12371  
    358358
    359359    if ( empty( $_POST['form_id'] ) || empty( $_POST['comment_id'] ) || ! is_numeric( $_POST['form_id'] ) || ! is_numeric( $_POST['comment_id'] ) ) {
     360        wp_send_json_error( $response );
     361    }
     362
     363    $activity_id   = (int) $_POST['form_id'];
     364    $activity_item = new BP_Activity_Activity( $activity_id );
     365    if ( ! bp_activity_user_can_read( $activity_item ) ) {
    360366        wp_send_json_error( $response );
    361367    }
Note: See TracChangeset for help on using the changeset viewer.