Ticket #3087: 3087.01.patch
File 3087.01.patch, 2.1 KB (added by , 14 years ago) |
---|
-
bp-core/bp-core-avatars.php
54 54 * Fetches an avatar from a BuddyPress object. Supports user/group/blog as 55 55 * default, but can be extended to include your own custom components too. 56 56 * 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. 59 59 * @param array $args Determine the output of this function 60 60 * @return string Formatted HTML <img> element, or raw avatar URL based on $html arg 61 61 */ … … 269 269 270 270 } else { 271 271 // 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 ); 273 273 } 274 274 275 275 if ( true === $html ) … … 526 526 if ( empty( $id ) ) 527 527 return !empty( $avatar ) ? $avatar : $default; 528 528 529 if ( !$alt ) 530 $alt = __( 'Avatar of %s', 'buddypress' ); 529 if ( !$alt ) 530 $alt = __( 'Avatar of %s', 'buddypress' ); 531 531 532 532 // Let BuddyPress handle the fetching of the avatar 533 533 $bp_avatar = bp_core_fetch_avatar( array( 'item_id' => $id, 'width' => $size, 'height' => $size, 'alt' => $alt ) ); … … 552 552 } 553 553 554 554 function 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'] ) ) 556 556 return false; 557 557 558 558 return true;