Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/19/2010 03:34:06 PM (17 years ago)
Author:
apeatling
Message:

Fixes #1591 - accessing non-existent profile field groups.

File:
1 edited

Legend:

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

    r2342 r2359  
    1212
    1313                if ( $id ) {
    14                         $this->populate($id);
     14                        $this->populate( $id );
    1515                }
    1616        }
     
    1919                global $wpdb, $bp;
    2020
    21                 $sql = $wpdb->prepare("SELECT * FROM {$bp->profile->table_name_groups} WHERE id = %d", $id);
    22 
    23                 if ( $group = $wpdb->get_row($sql) ) {
    24                         $this->id = $group->id;
    25                         $this->name = $group->name;
    26                         $this->description = $group->description;
    27                         $this->can_delete = $group->can_delete;
    28                 }
    29 
     21                $sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_groups} WHERE id = %d", $id );
     22
     23                if ( !$group = $wpdb->get_row($sql) )
     24                        return false;
     25
     26                $this->id = $group->id;
     27                $this->name = $group->name;
     28                $this->description = $group->description;
     29                $this->can_delete = $group->can_delete;
    3030        }
    3131
Note: See TracChangeset for help on using the changeset viewer.