Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2012 09:32:04 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Breathing room for cast variables.

File:
1 edited

Legend:

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

    r5696 r5729  
    9090
    9191        // Strip the sender from the recipient list if they exist
    92         if ( $key = array_search( $sender_id, (array)$recipient_ids ) )
     92        if ( $key = array_search( $sender_id, (array) $recipient_ids ) )
    9393            unset( $recipient_ids[$key] );
    9494
    9595        // Remove duplicates
    96         $recipient_ids = array_unique( (array)$recipient_ids );
     96        $recipient_ids = array_unique( (array) $recipient_ids );
    9797
    9898        if ( empty( $recipient_ids ) )
     
    100100
    101101        // Format this to match existing recipients
    102         foreach( (array)$recipient_ids as $i => $recipient_id ) {
     102        foreach( (array) $recipient_ids as $i => $recipient_id ) {
    103103            $message->recipients[$i]          = new stdClass;
    104104            $message->recipients[$i]->user_id = $recipient_id;
     
    109109
    110110        // Send screen notifications to the recipients
    111         foreach ( (array)$message->recipients as $recipient )
     111        foreach ( (array) $message->recipients as $recipient )
    112112            bp_core_add_notification( $message->id, $recipient->user_id, 'messages', 'new_message' );
    113113
     
    234234
    235235        if ( (int) $total_items > 1 ) {
    236             $text = sprintf( __('You have %d new messages', 'buddypress' ), (int)$total_items );
     236            $text = sprintf( __('You have %d new messages', 'buddypress' ), (int) $total_items );
    237237            $filter = 'bp_messages_multiple_new_message_notification';
    238238        } else {
    239             $text = sprintf( __('You have %d new message', 'buddypress' ), (int)$total_items );
     239            $text = sprintf( __('You have %d new message', 'buddypress' ), (int) $total_items );
    240240            $filter = 'bp_messages_single_new_message_notification';
    241241        }
     
    243243
    244244    if ( 'string' == $format ) {
    245         $return = apply_filters( $filter, '<a href="' . $link . '" title="' . $title . '">' . $text . '</a>', (int)$total_items, $text, $link );
     245        $return = apply_filters( $filter, '<a href="' . $link . '" title="' . $title . '">' . $text . '</a>', (int) $total_items, $text, $link );
    246246    } else {
    247247        $return = apply_filters( $filter, array(
Note: See TracChangeset for help on using the changeset viewer.