Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/06/2013 04:28:25 PM (12 years ago)
Author:
boonebgorges
Message:

Cast args to a new variable in messages_notification_new_message()

r7621 made it possible for this function to accept a $message object in
addition to an array, by casting the arguments to an array. However, this
caused downstream problems when the $message object was passed by reference,
as in the case of 'messages_message_sent'. This changeset leaves the passed
object untouched.

Fixes #5273

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages/bp-messages-notifications.php

    r7647 r7650  
    1717 *
    1818 * @since BuddyPress (1.0)
    19  * @param array $args
     19 * @param array $raw_args
    2020 */
    21 function messages_notification_new_message( $args = array() ) {
     21function messages_notification_new_message( $raw_args = array() ) {
    2222
    2323    // Cast possible $message object as an array
    24     if ( is_object( $args ) ) {
    25         $args = (array) $args;
     24    if ( is_object( $raw_args ) ) {
     25        $args = (array) $raw_args;
     26    } else {
     27        $args = $raw_args;
    2628    }
    2729
Note: See TracChangeset for help on using the changeset viewer.