Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/04/2018 11:05:58 AM (7 years ago)
Author:
djpaul
Message:

Activity, Akismet: fix infinite loop introduced in r11890

Props r-a-y

Fixes #6594

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/classes/class-bp-akismet.php

    r11890 r11950  
    415415            if (
    416416                Akismet::allow_discard() &&
    417                 ! empty( $activity_data['bp_as_result_headers']['X-akismet-pro-tip'] ) &&
    418                 $activity_data['bp_as_result_headers']['X-akismet-pro-tip'] === 'discard'
     417                ! empty( $activity_data['akismet_pro_tip'] ) &&
     418                'discard' === $activity_data['akismet_pro_tip']
    419419            ) {
    420420                // If this is so spammy it's not worth your time, let's just delete it.
     
    560560        remove_filter( 'akismet_ua', array( $this, 'buddypress_ua' ) );
    561561
    562         $activity_data['bp_as_result_headers'] = array();
    563         $activity_data['bp_as_result']         = '';
    564 
    565         // Get the response.
    566         if ( ! empty( $response[1] ) && ! is_wp_error( $response[1] ) ) {
    567             $activity_data['bp_as_result_headers'] = $response[0];
    568             $activity_data['bp_as_result']         = $response[1];
     562        // Save response data.
     563        $activity_data['bp_as_result'] = $response[1];
     564        if ( isset( $response[0]['x-akismet-pro-tip'] ) ) {
     565            $activity_data['akismet_pro_tip'] = $response[0]['x-akismet-pro-tip'];
    569566        }
    570567
Note: See TracChangeset for help on using the changeset viewer.