Ticket #4305: 4305.01.patch
File 4305.01.patch, 1.1 KB (added by , 12 years ago) |
---|
-
bp-messages/bp-messages-functions.php
function messages_new_message( $args = '' ) { 68 68 // Loop the recipients and convert all usernames to user_ids where needed 69 69 foreach( (array) $recipients as $recipient ) { 70 70 $recipient = trim( $recipient ); 71 71 72 if ( empty( $recipient ) ) 72 73 continue; 73 74 75 $recipient_id = false; 76 77 // input was numeric 74 78 if ( is_numeric( $recipient ) ) { 79 // do a check against the user ID column first 75 80 if ( bp_core_get_core_userdata( (int) $recipient ) ) 76 81 $recipient_id = (int) $recipient; 77 82 83 // if that fails, check against the user_login / user_nicename column 84 else { 85 if ( bp_is_username_compatibility_mode() ) 86 $recipient_id = bp_core_get_userid( (int) $recipient ); 87 else 88 $recipient_id = bp_core_get_userid_from_nicename( (int) $recipient ); 89 } 90 78 91 } else { 79 92 if ( bp_is_username_compatibility_mode() ) 80 93 $recipient_id = bp_core_get_userid( $recipient );