Skip to:
Content

BuddyPress.org

Ticket #3087: 3087.01.patch

File 3087.01.patch, 2.1 KB (added by r-a-y, 14 years ago)

Patch for BP 1.3-bleeding

  • bp-core/bp-core-avatars.php

     
    5454 * Fetches an avatar from a BuddyPress object. Supports user/group/blog as
    5555 * default, but can be extended to include your own custom components too.
    5656 *
    57  * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 
    58  * @global $current_blog WordPress global containing information and settings for the current blog being viewed. 
     57 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
     58 * @global $current_blog WordPress global containing information and settings for the current blog being viewed.
    5959 * @param array $args Determine the output of this function
    6060 * @return string Formatted HTML <img> element, or raw avatar URL based on $html arg
    6161 */
     
    269269
    270270        } else {
    271271                // No avatar was found, and we've been told not to use a gravatar.
    272                 $gravatar = apply_filters( "bp_core_default_avatar_$object", BP_PLUGIN_URL . '/bp-core/images/mystery-man.jpg', $params ); 
     272                $gravatar = apply_filters( "bp_core_default_avatar_$object", BP_PLUGIN_URL . '/bp-core/images/mystery-man.jpg', $params );
    273273        }
    274274
    275275        if ( true === $html )
     
    526526        if ( empty( $id ) )
    527527                return !empty( $avatar ) ? $avatar : $default;
    528528
    529         if ( !$alt ) 
    530                 $alt = __( 'Avatar of %s', 'buddypress' ); 
     529        if ( !$alt )
     530                $alt = __( 'Avatar of %s', 'buddypress' );
    531531
    532532        // Let BuddyPress handle the fetching of the avatar
    533533        $bp_avatar = bp_core_fetch_avatar( array( 'item_id' => $id, 'width' => $size, 'height' => $size, 'alt' => $alt ) );
     
    552552}
    553553
    554554function bp_core_check_avatar_type($file) {
    555         if ( ( !empty( $file['file']['type'] ) && !preg_match('/(jpe?g|gif|png)$/', $file['file']['type'] ) ) || !preg_match( '/(jpe?g|gif|png)$/', $file['file']['name'] ) )
     555        if ( ( !empty( $file['file']['type'] ) && !preg_match('/(jpe?g|gif|png)$/i', $file['file']['type'] ) ) || !preg_match( '/(jpe?g|gif|png)$/i', $file['file']['name'] ) )
    556556                return false;
    557557
    558558        return true;