Skip to content

Commit 053da1e

Browse files
committed
Fix initialization of autocreate and use_ssl
According to the documentation, both `OBJECTSTORE_S3_SSL` and `OBJECTSTORE_S3_AUTOCREATE` should default to `true`. Currently, when these environment variables are not set, they default to `false`. (See #2308). This fix works, because `strtolower(false)` returns the empty string. So when `OBJECTSTORE_S3_SSL` is not set and `getenv('OBJECTSTORE_S3_SSL')` returns `false`, the check `strtolower($use_ssl) !== 'false'` will evaluate to `true`. With this fix, both values will be `true` if they are * not set * the empty string * any string that is not equal to `false` when converted to lowercase This should now match the documented behavior. Signed-off-by: Valentin Brandl <[email protected]>
1 parent 6c1075b commit 053da1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.config/s3.config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
1515
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
1616
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
17-
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true,
18-
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true,
17+
'autocreate' => strtolower($autocreate) !== 'false',
18+
'use_ssl' => strtolower($use_ssl) !== 'false',
1919
// required for some non Amazon S3 implementations
2020
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
2121
// required for older protocol versions

0 commit comments

Comments
 (0)