WordPress.org

Make WordPress Core

Opened 23 months ago

Last modified 9 months ago

#42838 new defect (bug)

Manipulating uploads and images can break when using stream wrappers

Reported by: calin Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:
PR Number:

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 23 months ago.

Download all attachments as: .zip

Change History (2)

@calin
23 months ago

#1 @pento
9 months ago

  • Keywords has-patch added
  • Version trunk deleted
Note: See TracTickets for help on using tickets.