[buddypress-trac] [BuddyPress Trac] #8336: Cover Image Cannot be Uploaded on Windows Server using the REST endpoint

buddypress-trac noreply at wordpress.org
Fri Jul 24 21:11:35 UTC 2020


#8336: Cover Image Cannot be Uploaded on Windows Server using the REST endpoint
--------------------------+-----------------------------
 Reporter:  oddev56       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  high          |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  6.1.0
 Severity:  blocker       |   Keywords:  needs-patch
--------------------------+-----------------------------
 BuddyPress version 6.1.0.

 When using the REST endpoint for updating the member cover image
 (https://developer.buddypress.org/bp-rest-api/reference/attachments
 /member-cover-image/#definition-2), the error "The cover image directory
 is not valid" is returned.

 The issue is present in the file bp-core/trait-attachments.php on line 84,
 where the validate_file function is failing:

 if ( 0 !== validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) {

 Changing it to:

 if ( 1 === validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) {

 Fixes the issue.

 This same issue was present in the bp-core/bp-core-attachments.php file
 and was fixed with a patch, please see ticket #7674 for more information
 on this:

 1) Ticket link: https://buddypress.trac.wordpress.org/ticket/7674
 2) Patch link:
 https://buddypress.trac.wordpress.org/attachment/ticket/7674/7674.01.patch

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8336>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list