Make WordPress Core

Opened 7 years ago

Last modified 4 years ago

#42838 new defect (bug)

Manipulating uploads and images can break when using stream wrappers

Reported by: calin's profile calin Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch needs-refresh
Focuses: Cc:

Description

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.

Attachments (1)

dirname.diff (2.1 KB) - added by calin 7 years ago.

Download all attachments as: .zip

Change History (4)

@calin
7 years ago

#1 @pento
6 years ago

  • Keywords has-patch added
  • Version trunk deleted

#2 @sabernhardt
4 years ago

  • Component changed from General to Media
  • Keywords needs-refresh added

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


4 years ago

Note: See TracTickets for help on using tickets.