#2692 closed defect (bug) (fixed)
Lines order in ajax.php - bp_dtheme_delete_activity()
Reported by: | calvin_42 | Owned by: | |
---|---|---|---|
Milestone: | 1.2.7 | Priority: | trivial |
Severity: | Version: | ||
Component: | Templates | Keywords: | |
Cc: |
Description
Hi there!
There is a minor glitch in ajax.php. See bp_dtheme_delete_activity() (line 205).
Original :
$activity = new BP_Activity_Activity( $_POST['id'] ); /* Check access */ if ( !is_site_admin() && $activity->user_id != $bp->loggedin_user->id ) return false; if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) ) return false; /* Call the action before the delete so plugins can still fetch information about it */ do_action( 'bp_activity_action_delete_activity', $_POST['id'], $activity->user_id ); if ( !bp_activity_delete( array( 'id' => $_POST['id'], 'user_id' => $activity->user_id ) ) ) { echo '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>'; return false; }
Should be :
if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) ) return false; $activity = new BP_Activity_Activity( $_POST['id'] ); /* Check access */ if ( !is_site_admin() && $activity->user_id != $bp->loggedin_user->id ) return false; /* Call the action before the delete so plugins can still fetch information about it */ do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id ); if ( !bp_activity_delete( array( 'id' => $activity->id, 'user_id' => $activity->user_id ) ) ) { echo '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>'; return false; }
Change History (2)
Note: See
TracTickets for help on using
tickets.
(In [3327]) Fix #2692, props calvin_42