Skip to:
Content

BuddyPress.org

Ticket #8508: 8508.2.suggestion.patch

File 8508.2.suggestion.patch, 904 bytes (added by imath, 7 weeks ago)
  • src/bp-messages/classes/class-bp-messages-thread.php

    diff --git src/bp-messages/classes/class-bp-messages-thread.php src/bp-messages/classes/class-bp-messages-thread.php
    index 4c2d543a4..cd1f09bd2 100644
    class BP_Messages_Thread { 
    306306                        );
    307307
    308308                        $recipients = array();
    309                         foreach ( (array) $results as $recipient ) {
    310                                 $recipients[ $recipient->user_id ] = $recipient;
    311                         }
    312309
    313310                        // Cast all items from the messages DB table as integers.
    314                         foreach ( (array) $recipients as $key => $data ) {
    315                                 $recipients[ $key ] = (object) array_map( 'intval', (array) $data );
     311                        foreach ( (array) $results as $recipient ) {
     312                                $recipient_properties              = get_object_vars( $recipient );
     313                                $recipients[ $recipient->user_id ] = (object) array_map( 'intval', $recipient_properties );
    316314                        }
    317315
    318316                        // Cache recipients.