[wp-trac] [WordPress Trac] #42838: Manipulating uploads and images can break when using stream wrappers
WordPress Trac
noreply at wordpress.org
Fri Dec 8 12:30:07 UTC 2017
#42838: Manipulating uploads and images can break when using stream wrappers
--------------------------+-----------------------------
Reporter: calin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
When using PHP stream wrappers for storing uploads into object storages
(like S3 or Google Cloud Storage) some things break because in this
context a directory merely a path which ends in a '/'.
PHP's builtin `dirname` always returns the path without the trailing
slash. On regular filesystems this is not a problem since `a` and `a/` are
equivalent, but in the context of object storages this pose some issues.
I'm attaching a patch which always add a trailing slash when the code
expects to work with directories.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42838>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list