silverstripe / silverstripe-s3

Silverstripe module to store assets in S3 rather than on the local filesystem (SS4/SS5 only)
BSD 3-Clause "New" or "Revised" License
20 stars 25 forks source link

PublicCDNAdapter::getPublicUrl does not correctly url encode file paths #57

Open stnvh opened 1 year ago

stnvh commented 1 year ago

PublicCDNAdapter builds it's own URLs using Controller::join_links which does not explicitly produce an S3 compatible link due to lack of path encoding. For example if $path contains a + S3 treats this as a space, causing a 404.

This differs from PublicAdapter which builds links via the S3ClientInterface instead, in which paths are already escaped before being returned.