Skip to:
Content

BuddyPress.org

Changeset 4902


Ignore:
Timestamp:
07/30/2011 11:25:01 AM (15 years ago)
Author:
boonebgorges
Message:

Removes null recipients from recipient_ids array before attempting to send private message. Fixes #3411

Location:
trunk/bp-messages
Files:
2 edited

Legend:

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

    r4842 r4902  
    1010
    1111function messages_action_view_message() {
    12         global $thread_id;
     12        global $thread_id, $bp;
    1313
    1414        if ( !bp_is_messages_component() || !bp_is_current_action( 'view' ) )
  • trunk/bp-messages/bp-messages-functions.php

    r4825 r4902  
    5656                        $message->subject = __( 'No Subject', 'buddypress' );
    5757
    58                 $recipient_ids = array();
     58                $recipient_ids      = array();
     59               
     60                // Invalid recipients are added to an array, for future enhancements
     61                $invalid_recipients = array();
    5962
    6063                // Loop the recipients and convert all usernames to user_ids where needed
     
    6669                        if ( is_numeric( $recipient ) ) {
    6770                                if ( bp_core_get_core_userdata( (int) $recipient ) )
    68                                         $recipient_ids[] = (int) $recipient;
     71                                        $recipient_id = (int) $recipient;
    6972
    7073                        } else {
     
    7376                                else
    7477                                        $recipient_id = bp_core_get_userid_from_nicename( $recipient );
    75 
     78                        }
     79                       
     80                        if ( !$recipient_id )
     81                                $invalid_recipients[] = $recipient;
     82                        else
    7683                                $recipient_ids[] = (int) $recipient_id;
    77                         }
    7884                }
    7985
Note: See TracChangeset for help on using the changeset viewer.