get_task_comment($comment_id); if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_permission('change_task_details',$task_id) || $current_user->ID == $task_comment['created_by'])) {exit;} if ( check_ajax_referer( 'wppm_set_edit_task_thread', '_ajax_nonce', false ) != 1 ) { wp_send_json_error( 'Unauthorised request!', 401 ); } $task_comment_data = $wppmfunction->get_task_comment($comment_id); $old_comment_body = $task_comment_data['body']; $allowed_tags = array( 'br' => array(), 'abbr' => array('title' => array(),), 'p' => array(), 'strong' => array(), 'a' => array('href' => array(), 'title' => array(), 'rel'=> array(), 'target'=> array()),'em' =>array(),'span' =>array(), 'blockquote'=>array('cite' => array(),),'div' => array('class' => array(),'title' => array(),'style' => array(),),'ul'=>array(),'li'=>array(),'ol'=>array(),'img' => array( 'alt'=> array(),'class' => array(),'height' => array(),'src'=> array(),'width'=> array(),)); $new_task_comment = !empty($_POST['wppm_edit_task_thread']) ? wp_kses(wp_unslash($_POST['wppm_edit_task_thread']), $allowed_tags) : "" ; if($new_task_comment && $old_comment_body != $new_task_comment ){ $wppmfunction->change_task_comment($comment_id, $new_task_comment); }