Skip to:
Content

BuddyPress.org

Ticket #3087: 3087.02.patch

File 3087.02.patch, 936 bytes (added by r-a-y, 14 years ago)

Patch for BP 1.2-branch

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

     
    478478 */
    479479function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt ) {
    480480        global $pagenow;
    481        
     481
    482482        // Do not filter if inside WordPress options page
    483483        if ( 'options-discussion.php' == $pagenow )
    484484                return $avatar;
    485        
     485
    486486        // If passed an object, assume $user->user_id
    487487        if ( is_object( $user ) )
    488488                $id = $user->user_id;
     
    522522}
    523523
    524524function bp_core_check_avatar_type($file) {
    525         if ( ( !empty( $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)$/i', $file['file']['type'] ) ) || !preg_match( '/(jpe?g|gif|png)$/i', $file['file']['name'] ) )
    526526                return false;
    527527
    528528        return true;