MaxServ / t3ext-fal_s3

S3 driver for FAL
GNU General Public License v2.0
13 stars 10 forks source link

[Bugfix] Metadata updated even if no cache control has been set #51

Closed maechler closed 5 years ago

maechler commented 5 years ago

The variable $cacheControl is initialised with null: https://github.com/MaxServ/t3ext-fal_s3/blob/fe076675088f2ab0ed4bae80e44474a22eb1ca92/Classes/CacheControl/RemoteObjectUpdater.php#L110

But it will always be changed to a string after one of the following methods has been called, because implode(',', []) returns an empty string instead of null. https://github.com/MaxServ/t3ext-fal_s3/blob/fe076675088f2ab0ed4bae80e44474a22eb1ca92/Classes/CacheControl/RemoteObjectUpdater.php#L138-L145

Thus the following condition is not working to check whether metadata should be updated or not. https://github.com/MaxServ/t3ext-fal_s3/blob/fe076675088f2ab0ed4bae80e44474a22eb1ca92/Classes/CacheControl/RemoteObjectUpdater.php#L147-L151

I changed the condition to !empty($cacheControl), which detects null as well as empty strings.