Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/15/2009 07:24:11 PM (17 years ago)
Author:
apeatling
Message:

Fixing vulnerability in group avatars.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/bp-groups/bp-groups-templatetags.php

    r1475 r1483  
    274274       
    275275        if ( $group_obj->avatar_full ) { ?>
    276                 <img src="<?php echo $group_obj->avatar_full ?>" alt="<?php _e( 'Group Avatar', 'buddypress' ) ?>" class="avatar" />
     276                <img src="<?php echo attribute_escape( $group_obj->avatar_full ) ?>" alt="<?php _e( 'Group Avatar', 'buddypress' ) ?>" class="avatar" />
    277277        <?php } else { ?>
    278278                <img src="<?php echo $bp->groups->image_base . '/none.gif' ?>" alt="<?php _e( 'No Group Avatar', 'buddypress' ) ?>" class="avatar" />
    … …  
    307307                        <li>
    308308                                <div class="item-avatar">
    309                                         <a href="<?php echo bp_get_group_permalink( $group ) ?>" title="<?php echo $group->name ?>"><img src="<?php echo $group->avatar_thumb ?>" class="avatar" alt="<?php printf( __( '%s Avatar', 'buddypress' ), $group->name ) ?>" /></a>
     309                                        <a href="<?php echo bp_get_group_permalink( $group ) ?>" title="<?php echo $group->name ?>"><img src="<?php echo attribute_escape( $group->avatar_thumb ) ?>" class="avatar" alt="<?php printf( __( '%s Avatar', 'buddypress' ), $group->name ) ?>" /></a>
    310310                                </div>
    311311
    … …  
    361361                                }
    362362                        ?>                              <li>
    363                                         <a href="<?php echo bp_get_group_permalink( $group ) ?>"><img src="<?php echo $group->avatar_thumb; ?>" class="avatar" alt="<?php _e( 'Group Avatar', 'buddypress' ) ?>" /></a>
     363                                        <a href="<?php echo bp_get_group_permalink( $group ) ?>"><img src="<?php echo attribute_escape( $group->avatar_thumb ); ?>" class="avatar" alt="<?php _e( 'Group Avatar', 'buddypress' ) ?>" /></a>
    364364                                        <h5><a href="<?php echo bp_get_group_permalink( $group ) ?>"><?php echo $group->name ?></a></h5>
    365365                                </li>
    … …  
    706706                        $group =& $groups_template->group;
    707707
    708                 return apply_filters( 'bp_get_group_avatar', '<img src="' . $group->avatar_full . '" class="avatar" alt="' . $group->name . '" />', $group->avatar_full, $group->avatar_name );
     708                return apply_filters( 'bp_get_group_avatar', '<img src="' . attribute_escape( $group->avatar_full ) . '" class="avatar" alt="' . attribute_escape( $group->name ) . '" />', $group->avatar_full, $group->avatar_name );
    709709        }
    710710
    … …  
    718718                        $group =& $groups_template->group;
    719719
    720                 return apply_filters( 'bp_get_group_avatar_thumb', '<img src="' . $group->avatar_thumb . '" class="avatar" alt="' . $group->name . '" />', $group->avatar_thumb, $group->avatar_name );
     720                return apply_filters( 'bp_get_group_avatar_thumb', '<img src="' . attribute_escape( $group->avatar_thumb ) . '" class="avatar" alt="' . attribute_escape( $group->name ) . '" />', $group->avatar_thumb, $group->avatar_name );
    721721        }
    722722
    … …  
    730730                        $group =& $groups_template->group;
    731731
    732                 return apply_filters( 'bp_get_group_avatar_mini', '<img src="' . $group->avatar_thumb . '" class="avatar" width="30" height="30" alt="' . $group->name . '" />', $group->avatar_thumb, $group->avatar_name );
     732                return apply_filters( 'bp_get_group_avatar_mini', '<img src="' . attribute_escape( $group->avatar_thumb ) . '" class="avatar" width="30" height="30" alt="' . attribute_escape( $group->name ) . '" />', $group->avatar_thumb, $group->avatar_name );
    733733        }
    734734
Note: See TracChangeset for help on using the changeset viewer.