[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 31 16:43:03 UTC 2020


#8336: Cover Image Cannot be Uploaded on Windows Server using the REST endpoint
-------------------------+--------------------------
 Reporter:  oddev56      |       Owner:  espellcaste
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  7.0.0
Component:  REST API     |     Version:  6.1.0
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+--------------------------

Comment (by oddev56):

 Replying to [comment:3 imath]:
 > Hi @oddev56 I'm sorry but we have nothing to change there. The WordPress
 function `validate_file()` must return `0` to validate the file, otherwise
 something is wrong with the file. If you get the error code `1` then it
 means the file path you used is either:
 > - equals to `../` which is forbidden,
 > - has more than one occurence of `../` which is not allowed,
 > - or has `../` not occuring at the end of the path which is not allowed.
 >
 > Are you filtering the default BuddyPress upload path? If so remove your
 filter and test again, imho the path you're returning to the upload path
 filter is not good.

 Hello @imath , thanks for your reply.

 This is the same issue that was fixed 2 years ago on the bp-core/bp-core-
 attachments.php file, please check the ticket and patch linked on my first
 comment:

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

 You can check the discussion there as to what the issue is with windows
 servers and the validate_file function and why this was changed.

 Please check that the current bp-core/bp-core-attachments.php file
 (https://github.com/buddypress/BuddyPress/blob/master/src/bp-core/bp-core-
 attachments.php) always compares validate_file to 1, to fix this issue on
 windows servers, but it seems that this fix wasn't taken into
 consideration when creating the REST endpoint that allows for cover image
 uploads.

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


More information about the buddypress-trac mailing list