Skip to:
Content

BuddyPress.org

Changeset 6023


Ignore:
Timestamp:
05/11/2012 05:55:13 PM (13 years ago)
Author:
boonebgorges
Message:

Don't assign values to undefined objects throughout BP. Fixes #4191. Props leemour

Location:
trunk
Files:
5 edited

Legend:

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

    r5993 r6023  
    198198
    199199    // Set activity action
     200    if ( !isset( $bp->activity->actions ) || !is_object( $bp->activity->actions ) ) {
     201        $bp->activity->actions = new stdClass;
     202    }
     203
     204    if ( !isset( $bp->activity->actions->{$component_id} ) || !is_object( $bp->activity->actions->{$component_id} ) ) {
     205        $bp->activity->actions->{$component_id} = new stdClass;
     206    }
     207
    200208    $bp->activity->actions->{$component_id}->{$key} = apply_filters( 'bp_activity_set_action', array(
    201209        'key'   => $key,
  • trunk/bp-core/bp-core-avatars.php

    r6022 r6023  
    4949function bp_core_set_avatar_globals() {
    5050    global $bp;
     51
     52    $bp->avatar        = new stdClass;
     53    $bp->avatar->thumb = new stdClass;
     54    $bp->avatar->full  = new stdClass;
    5155
    5256    // Dimensions
  • trunk/bp-core/bp-core-functions.php

    r6022 r6023  
    179179            foreach ( (array) $page_names as $page_name ) {
    180180                if ( $page_name->ID == $page_id ) {
     181                    if ( !isset( $pages->{$component_id} ) || !is_object( $pages->{$component_id} ) ) {
     182                        $pages->{$component_id} = new stdClass;
     183                    }
     184
    181185                    $pages->{$component_id}->name  = $page_name->post_name;
    182186                    $pages->{$component_id}->id    = $page_name->ID;
  • trunk/bp-core/bp-core-loader.php

    r6022 r6023  
    163163
    164164        // The user ID of the user who is currently logged in.
     165        $bp->loggedin_user       = new stdClass;
    165166        $bp->loggedin_user->id   = isset( $current_user->ID ) ? $current_user->ID : 0;
    166167
     
    168169
    169170        // Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar
     171        $bp->grav_default        = new stdClass;
    170172        $bp->grav_default->user  = apply_filters( 'bp_user_gravatar_default',  $bp->site_options['avatar_default'] );
    171173        $bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', $bp->grav_default->user );
  • trunk/bp-forums/bp-forums-template.php

    r5999 r6023  
    10381038        $this->topic_tags = bb_get_topic_tags( $this->topic_id );
    10391039
     1040        $this->pag = new stdClass;
     1041
    10401042        if ( (int) $this->total_post_count && (int) $this->pag_num ) {
    10411043            $this->pag_links = paginate_links( array(
Note: See TracChangeset for help on using the changeset viewer.