diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d298bd..0af3eee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). In order to read more about upgrading and BC breaks have a look at the [UPGRADE Document](UPGRADE.md). +## 1.7.0 + ++ allow the `acl` param to be null, since certain storage system throw an error if an unsupported header value is provided. + ## 1.6.0 (12. April 2023) + **Removed Testing for PHP 7.0, 7.1, 7.2 and 7.3** diff --git a/src/S3FileSystem.php b/src/S3FileSystem.php index 214da06..1b45d73 100644 --- a/src/S3FileSystem.php +++ b/src/S3FileSystem.php @@ -57,7 +57,8 @@ class S3FileSystem extends BaseFileSystemStorage public $region; /** - * @var string The ACL default permission when writing new files. All available options are `private|public-read|public-read-write|authenticated-read|aws-exec-read|bucket-owner-read|bucket-owner-full-control` + * @var string The ACL default permission when writing new files. All available options are `private|public-read|public-read-write|authenticated-read|aws-exec-read|bucket-owner-read|bucket-owner-full-control` if null, this header + * will be ignored. */ public $acl = 'public-read'; @@ -132,7 +133,9 @@ public function extendPutObject(array $config) $config['CacheControl'] = 'max-age=' . $this->maxAge; } - return $config; + // remove null values from the config, + // this is mainly usfull if acl is set to null. + return array_filter($config); } private $_client; @@ -245,12 +248,12 @@ public function updateBucketPolicy($policy) */ public function folderCreate($folder) { - return $this->client->putObject([ + return $this->client->putObject(array_filter([ 'ACL' => $this->acl, 'Bucket' => $this->bucket, 'Key' => rtrim($folder, '/') . '/', 'Body' => "", - ]); + ])); } /**