Skip to:
Content

BuddyPress.org

Changeset 8828


Ignore:
Timestamp:
08/13/2014 07:01:26 PM (10 years ago)
Author:
r-a-y
Message:

bp-legacy: Fix 'Maximum Execution Time' fatal error when attempting to reply to an activity item.

Changes in r8708 caused an infinite loop to occur while manually
determining the activity comment's depth. This is due to the type casting
in r8708.

To fix this in bp-legacy, we also type cast the various item IDs to prevent
the infinite loop from occurring.

Fixes #5811.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r8772 r8828  
    793793        // determine depth
    794794        $depth = 1;
    795         $parent_id = $activities_template->activities[0]->secondary_item_id;
    796         while ( $parent_id !== $activities_template->activities[0]->item_id ) {
     795        $parent_id = (int) $activities_template->activities[0]->secondary_item_id;
     796        while ( $parent_id !== (int) $activities_template->activities[0]->item_id ) {
    797797            $depth++;
    798798            $p_obj = new BP_Activity_Activity( $parent_id );
    799             $parent_id = $p_obj->secondary_item_id;
     799            $parent_id = (int) $p_obj->secondary_item_id;
    800800        }
    801801        $activities_template->activity->current_comment->depth = $depth;
Note: See TracChangeset for help on using the changeset viewer.