Skip to:
Content

BuddyPress.org

Changeset 13752


Ignore:
Timestamp:
03/08/2024 01:33:21 AM (11 months ago)
Author:
imath
Message:

Only parse heartbeat requests which relates to BuddyPress context

Props Slaffik, needle, espellcaste

See #9099 (trunk)
Closes https://github.com/buddypress/buddypress/pull/247

Location:
trunk/src/bp-core
Files:
2 edited

Legend:

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

    r13694 r13752  
    3131    // Only set BuddyPress URI globals for registered Ajax actions.
    3232    if ( ! bp_ajax_action_is_registered( $action ) ) {
     33        return;
     34    }
     35
     36    if ( 'heartbeat' === $action && empty( $_REQUEST['data']['bp_heartbeat'] ) ) {
    3337        return;
    3438    }
  • trunk/src/bp-core/bp-core-template-loader.php

    r13735 r13752  
    620620    }
    621621
     622    if ( isset( $_POST['action'] ) && 'heartbeat' === $_POST['action'] && empty( $_POST['data']['bp_heartbeat'] ) ) {
     623        return;
     624    }
     625
    622626    // Prevent doing this again.
    623627    remove_action( 'parse_query', 'bp_parse_ajax_referer_query', 2 );
Note: See TracChangeset for help on using the changeset viewer.