[buddypress-trac] [BuddyPress] #3119: Avatar uploads do not accept files with uppercase extensions.

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Mon Mar 21 14:37:33 UTC 2011


#3119: Avatar uploads do not accept files with uppercase extensions.
----------------------------+-----------------------------
 Reporter:  CPilko          |      Owner:
     Type:  defect          |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Core            |    Version:  1.2.8
 Keywords:  avatar, upload  |
----------------------------+-----------------------------
 Attempting to upload a valid file with an uppercase extension gives an
 error "Please upload only JPG, GIF or PNG photos."

 Line 525 of /bp-core/bp-core-avatars.php should be changed from:

 {{{
         if ( ( !empty( $file['file']['type'] ) &&
 !preg_match('/(jpe?g|gif|png)$/', $file['file']['type'] ) ) ||
 !preg_match( '/(jpe?g|gif|png)$/', $file['file']['name'] ) )
 }}}

 to a case insensitive preg_match.

 {{{
         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'] ) )
 }}}

-- 
Ticket URL: <https://trac.buddypress.org/ticket/3119>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list