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-avatars.php

    r11670 r11858  
    810810 */
    811811function bp_avatar_ajax_delete() {
    812     // Bail if not a POST action.
    813     if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
     812    if ( ! bp_is_post_request() ) {
    814813        wp_send_json_error();
    815814    }
     
    953952 */
    954953function bp_avatar_ajax_upload() {
    955     // Bail if not a POST action.
    956     if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
     954    if ( ! bp_is_post_request() ) {
    957955        wp_die();
    958956    }
     
    12381236 */
    12391237function bp_avatar_ajax_set() {
    1240     // Bail if not a POST action.
    1241     if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
     1238    if ( ! bp_is_post_request() ) {
    12421239        wp_send_json_error();
    12431240    }
Note: See TracChangeset for help on using the changeset viewer.