Skip to:
Content
Pages
Categories
Search
Top
Bottom

[FIX ?]can’t upload avatar with uppercase extension

  • I’m fairly new to BuddyPress, and today i noticed that i can’t upload pictures with and uppercase extension, so i looked into the code and i found this function in buddypress/bp-core/bp-core-avatars.php, line 524:

    `function bp_core_check_avatar_type($file) {
    if ( ( !empty( $file ) && !preg_match(‘/(jpe?g|gif|png)$/’, $file ) ) || !preg_match( ‘/(jpe?g|gif|png)$/’, $file ) )
    return false;

    return true;
    }`

    I simply added a ‘i’ to the final of the both regular expressions to make them case insensitive, the result:

    `function bp_core_check_avatar_type($file) {
    if ( ( !empty( $file ) && !preg_match(‘/(jpe?g|gif|png)$/i’, $file ) ) || !preg_match( ‘/(jpe?g|gif|png)$/i’, $file ) )
    return false;

    return true;
    }`

    So, i wondering, is this a real fix? or i missed something?

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[FIX ?]can’t upload avatar with uppercase extension’ is closed to new replies.
Skip to toolbar