diff options
author | wn_ <[email protected]> | 2022-12-02 19:37:09 +0000 |
---|---|---|
committer | wn_ <[email protected]> | 2022-12-02 19:37:29 +0000 |
commit | 183618e89372b9370b848842f0d7d9ad22a9a60d (patch) | |
tree | 29ea39a8b4686f0892294c65161c8144ddd3913c | |
parent | 188df4f99a79485b6d8bd353bf384e4a7eec11df (diff) |
Prevent double slashes in full path.
During housekeeping 'Cache_S3' gets initialized with an empty 'dir' value. This resulted in consecutive forward slashes in 'Cache_S3::get_full_path()', which prevented detection of directories and resulted in an empty list of rules. 'putBucketLifecycleConfiguration' with an empty list of rules causes a malformed XML error with AWS S3.
-rw-r--r-- | init.php | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -87,7 +87,7 @@ class Cache_S3 extends Plugin implements Cache_Adapter { } public function get_full_path(string $filename): string { - return 's3://' . Config::get(self::CACHE_S3_BUCKET) . '/' . $this->dir . '/' . basename(clean($filename)); + return 's3://' . Config::get(self::CACHE_S3_BUCKET) . '/' . ($this->dir ? $this->dir . '/' : '') . basename(clean($filename)); } public function get_mime_type(string $filename) { |