Skip to content
Snippets Groups Projects
  • Valentin Brandl's avatar
    d3341b61
    Fix initialization of `autocreate` and `use_ssl` (#2309) · d3341b61
    Valentin Brandl authored
    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 https://github.com/nextcloud/docker/issues/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: default avatarValentin Brandl <mail@vbrandl.net>
    d3341b61
    History
    Fix initialization of `autocreate` and `use_ssl` (#2309)
    Valentin Brandl authored
    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 https://github.com/nextcloud/docker/issues/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: default avatarValentin Brandl <mail@vbrandl.net>