aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/classes/Config.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/classes/Config.php b/lib/classes/Config.php
index 20eebdc..d3e5419 100644
--- a/lib/classes/Config.php
+++ b/lib/classes/Config.php
@@ -349,6 +349,15 @@ class Config implements ArrayAccess, Countable, IteratorAggregate
if (!$entry->isNew()) {
throw new InvalidArgumentException("config $field already exists");
}
+
+ if (isset($data['value'])) {
+ $data['value'] = $this->convertForDatabase(
+ $data['type'] ?? 'string',
+ $data['value'],
+ $field
+ );
+ }
+
$entry->setData($data);
$ret = $entry->store() ? $entry : null;
if ($ret) {