summaryrefslogtreecommitdiff
path: root/classes/config.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-03-07 09:00:36 +0300
committerAndrew Dolgov <[email protected]>2021-03-07 09:00:36 +0300
commit5bb871483999235acbe80849608c5cb98d0fd45c (patch)
tree2081c83a16652c7cdcf38e1562908eb62a55777a /classes/config.php
parent77b5201b7dcd101c4d8d7a0b163449d29a353e60 (diff)
allow blank override values
Diffstat (limited to 'classes/config.php')
-rw-r--r--classes/config.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/classes/config.php b/classes/config.php
index cd10c0158..3e643b2d0 100644
--- a/classes/config.php
+++ b/classes/config.php
@@ -139,7 +139,7 @@ class Config {
list ($defval, $deftype) = $this::_DEFAULTS[$const];
- $this->params[$cvalue] = [ self::cast_to(!empty($override) ? $override : $defval, $deftype), $deftype ];
+ $this->params[$cvalue] = [ self::cast_to($override !== false ? $override : $defval, $deftype), $deftype ];
}
}
}
@@ -264,7 +264,7 @@ class Config {
private function _add(string $param, string $default, int $type_hint) {
$override = getenv($this::_ENVVAR_PREFIX . $param);
- $this->params[$param] = [ self::cast_to(!empty($override) ? $override : $default, $type_hint), $type_hint ];
+ $this->params[$param] = [ self::cast_to($override !== false ? $override : $default, $type_hint), $type_hint ];
}
static function add(string $param, string $default, int $type_hint = Config::T_STRING) {