Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/16/2019 02:41:12 PM (5 years ago)
Author:
dcavins
Message:

User Messages Export: Avoid invalid argument for foreach().

Ensure that BP_Messages_Thread::get_current_threads_for_user() returns valid threads before iterating over $user_threads['threads'].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/bp-messages-functions.php

    r12403 r12448  
    669669        'page'    => $page,
    670670    ) );
     671
     672    if ( empty( $user_threads ) ) {
     673        return array(
     674            'data' => $data_to_export,
     675            'done' => true,
     676        );
     677    }
    671678
    672679    foreach ( $user_threads['threads'] as $thread ) {
Note: See TracChangeset for help on using the changeset viewer.