Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/15/2018 03:52:40 PM (8 years ago)
Author:
espellcaste
Message:

Make use of bp_is_post_request() instead of hardcoding POST verifications directly.

BuddyPress is not making use of the bp_is_post_request() in several ajax scenarios to confirm if the post request is indeed a POST request. Instead, it is hardcoding the check directly. This change updates those places making use of this function.

Props DjPaul

Fixes #7684

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-attachments.php

    r11841 r11858  
    11901190 */
    11911191function bp_attachments_cover_image_ajax_upload() {
    1192     if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
     1192    if ( ! bp_is_post_request() ) {
    11931193        wp_die();
    11941194    }
     
    13791379 */
    13801380function bp_attachments_cover_image_ajax_delete() {
    1381     if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
     1381    if ( ! bp_is_post_request() ) {
    13821382        wp_send_json_error();
    13831383    }
Note: See TracChangeset for help on using the changeset viewer.