Skip to:
Content

BuddyPress.org


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-core/bp-core-avatars.php

    r3141 r3851  
    523523
    524524function bp_core_check_avatar_type($file) {
    525     if ( ( strlen($file['file']['type']) && !preg_match('/(jpe?g|gif|png)$/', $file['file']['type'] ) ) && !preg_match( '/(jpe?g|gif|png)$/', $file['file']['name'] ) )
     525    if ( ( !empty( $file['file']['type'] ) && !preg_match('/(jpe?g|gif|png)$/', $file['file']['type'] ) ) || !preg_match( '/(jpe?g|gif|png)$/', $file['file']['name'] ) )
    526526        return false;
    527527
     
    568568    // If multisite, and current blog does not match root blog, make adjustments
    569569    if ( bp_core_is_multisite() && BP_ROOT_BLOG != $current_blog->blog_id )
    570         $upload_dir['baseurl'] = str_replace( get_blog_option( $current_blog->blog_id, 'home' ) , get_blog_option( BP_ROOT_BLOG, 'home' ), $upload_dir['baseurl'] );
     570        $upload_dir['baseurl'] = trailingslashit( get_blog_option( BP_ROOT_BLOG, 'home' ) ) . get_blog_option( BP_ROOT_BLOG, 'upload_path' );
    571571
    572572    return apply_filters( 'bp_core_avatar_url', $upload_dir['baseurl'] );
Note: See TracChangeset for help on using the changeset viewer.