- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-core/bp-core-avatars.php
r3141 r3851 523 523 524 524 function 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'] ) ) 526 526 return false; 527 527 … … 568 568 // If multisite, and current blog does not match root blog, make adjustments 569 569 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' ); 571 571 572 572 return apply_filters( 'bp_core_avatar_url', $upload_dir['baseurl'] );
Note: See TracChangeset
for help on using the changeset viewer.