[buddypress-trac] [BuddyPress Trac] #6278: Attachment Library

buddypress-trac noreply at wordpress.org
Thu Mar 5 11:06:37 UTC 2015


#6278: Attachment Library
------------------------------------+------------------
 Reporter:  imath                   |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  2.3
Component:  API                     |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------

Comment (by imath):

 @johnjamesjacoby i've tested 6278.02.patch. This is shaping good :)

 A few suggestions :
 > Added test_form to wp_handle_upload() overrides, so form submission
 works

 I think we shouldn't bypass the test form. Your form submission wasn't
 working because the upload action was not set. Defining `test_form` to
 false simply allow any upload.

 So i moved the `'bp_avatar_upload'` into the arguments of `$bp->avatar =
 new BP_Attachment_Avatar( $args );`

 I've also introduced a new global : $bp->upload_dir so that the first to
 use BP_Attachment will define once and for all the upload dir so we
 eventually switch blog only once.

 Finally i think we should provide a way to restrict uploads by mime types.
 So i've introduced a new property $allowed_mime_types.

 About the way WordPress is managing this is a bit annoying it restricts
 the download, which is good but the message is a bit weird ('Sorry, this
 file type is not permitted for security reasons.') and i think we cannot
 override it. That's why i keep on using the specific rule for avatars.

 see BP_Attachment->validate_mime_types() for some other comments.

 I've included these points in 6278.03.patch

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6278#comment:11>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list