Improved handling of non string values in the config
This commit is contained in:
parent
becfeaf0b7
commit
422be7e212
|
@ -139,13 +139,10 @@ class Config {
|
|||
public static function set($family, $key, $value) {
|
||||
$a = get_app();
|
||||
|
||||
// We always store boolean values as integer.
|
||||
// And when fetching we don't convert them back to boolean.
|
||||
// We store our setting values in a string variable.
|
||||
// So we have to do the conversion here so that the compare below works.
|
||||
$dbvalue = (is_bool($value) ? (string)intval($value) : $value);
|
||||
|
||||
// Convert the numeric values to string to make the compare work
|
||||
$dbvalue = (is_numeric($value) ? (string)$value : $dbvalue);
|
||||
// The exception are array values.
|
||||
$dbvalue = (!is_array($value) ? (string)$value : $value);
|
||||
|
||||
$stored = self::get($family, $key);
|
||||
|
||||
|
|
Loading…
Reference in a new issue