- Timestamp:
- 11/07/2023 10:41:34 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/includes/activity/ajax.php
r13503 r13636 104 104 $activity_id = (int) $_POST['id']; 105 105 $activity_item = new BP_Activity_Activity( $activity_id ); 106 if ( ! bp_activity_user_can_read( $activity_item, bp_loggedin_user_id() ) ) {107 wp_send_json_error(); 108 } 109 110 if ( bp_activity_add_user_favorite( $ _POST['id']) ) {106 if ( empty( $activity_item->id ) || ! bp_activity_user_can_read( $activity_item, bp_loggedin_user_id() ) ) { 107 wp_send_json_error(); 108 } 109 110 if ( bp_activity_add_user_favorite( $activity_id ) ) { 111 111 $response = array( 'content' => __( 'Remove Favorite', 'buddypress' ) ); 112 112 … … 150 150 } 151 151 152 if ( bp_activity_remove_user_favorite( $_POST['id'] ) ) { 152 $activity_id = (int) $_POST['id']; 153 154 if ( bp_activity_remove_user_favorite( $activity_id ) ) { 153 155 $response = array( 'content' => __( 'Mark as Favorite', 'buddypress' ) ); 154 156
Note: See TracChangeset
for help on using the changeset viewer.