Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/21/2011 07:22:17 PM (14 years ago)
Author:
djpaul
Message:

Fix deleting activity stream items. Fixes #3272

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r4524 r4548  
    241241    }
    242242
    243     if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) )
    244         return false;
     243    if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) ) {
     244        echo '-1';
     245        return false;
     246    }
    245247
    246248    $activity = new BP_Activity_Activity( (int) $_POST['id'] );
    247249
    248250    // Check access
    249     if ( !bp_activity_user_can_delete() )
    250         return false;
     251    if ( empty( $activity->user_id ) || !bp_activity_user_can_delete( $activity ) ) {
     252        echo '-1';
     253        return false;
     254    }
    251255
    252256    // Call the action before the delete so plugins can still fetch information about it
     
    257261        return false;
    258262    }
    259    
     263
    260264    do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id );
    261265
Note: See TracChangeset for help on using the changeset viewer.