Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/22/2016 10:32:06 PM (8 years ago)
Author:
r-a-y
Message:

Messages: Cast properties as integers where appropriate.

See #6977.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/classes/class-bp-messages-thread.php

    r10417 r11028  
    255255        }
    256256
     257        // Cast all items from the messages DB table as integers.
     258        foreach ( (array) $recipients as $key => $data ) {
     259            $recipients[ $key ] = (object) array_map( 'intval', (array) $data );
     260        }
     261
    257262        /**
    258263         * Filters the recipients of a message thread.
     
    290295
    291296            wp_cache_set( $thread_id, (array) $messages, 'bp_messages_threads' );
     297        }
     298
     299        // Integer casting.
     300        foreach ( $messages as $key => $data ) {
     301            $messages[ $key ]->id        = (int) $messages[ $key ]->id;
     302            $messages[ $key ]->thread_id = (int) $messages[ $key ]->thread_id;
     303            $messages[ $key ]->sender_id = (int) $messages[ $key ]->sender_id;
    292304        }
    293305
Note: See TracChangeset for help on using the changeset viewer.