Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/03/2010 09:06:27 PM (15 years ago)
Author:
apeatling
Message:

Fixes #1551 - also safeguarded all foreach loops with an array typecast.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-classes.php

    r2541 r2576  
    319319
    320320        /* Now fetch the activity comments and parse them into the correct position in the activities array. */
    321         foreach( $activities as $activity ) {
     321        foreach( (array)$activities as $activity ) {
    322322            if ( 'activity_comment' != $activity->type && $activity->mptt_left && $activity->mptt_right )
    323323                $activity_comments[$activity->id] = BP_Activity_Activity::get_activity_comments( $activity->id, $activity->mptt_left, $activity->mptt_right );
     
    325325
    326326        /* Merge the comments with the activity items */
    327         foreach( $activities as $key => $activity )
     327        foreach( (array)$activities as $key => $activity )
    328328            $activities[$key]->children = $activity_comments[$activity->id];
    329329
     
    345345
    346346        /* Loop descendants and build an assoc array */
    347         foreach ( $descendants as $d ) {
     347        foreach ( (array)$descendants as $d ) {
    348348            $d->children = array();
    349349
     
    373373
    374374        /* Loop the descendants and recalculate the left and right values */
    375         foreach ( $descendants as $descendant )
     375        foreach ( (array)$descendants as $descendant )
    376376            $right = BP_Activity_Activity::rebuild_activity_comment_tree( $descendant->id, $right );
    377377
Note: See TracChangeset for help on using the changeset viewer.