Fix Config and PConfig ::get() on new keys
This commit is contained in:
parent
869a439466
commit
6e28cdf2ee
2 changed files with 2 additions and 2 deletions
|
@ -172,7 +172,7 @@ class Config {
|
||||||
// manage array value
|
// manage array value
|
||||||
$dbvalue = (is_array($value)?serialize($value):$value);
|
$dbvalue = (is_array($value)?serialize($value):$value);
|
||||||
$dbvalue = (is_bool($dbvalue) ? intval($dbvalue) : $dbvalue);
|
$dbvalue = (is_bool($dbvalue) ? intval($dbvalue) : $dbvalue);
|
||||||
if(self::get($family,$key,null,true) === false) {
|
if(is_null(self::get($family,$key,null,true))) {
|
||||||
$a->config[$family][$key] = $value;
|
$a->config[$family][$key] = $value;
|
||||||
$ret = q("INSERT INTO `config` ( `cat`, `k`, `v` ) VALUES ( '%s', '%s', '%s' ) ",
|
$ret = q("INSERT INTO `config` ( `cat`, `k`, `v` ) VALUES ( '%s', '%s', '%s' ) ",
|
||||||
dbesc($family),
|
dbesc($family),
|
||||||
|
|
|
@ -161,7 +161,7 @@ class PConfig {
|
||||||
// manage array value
|
// manage array value
|
||||||
$dbvalue = (is_array($value)?serialize($value):$value);
|
$dbvalue = (is_array($value)?serialize($value):$value);
|
||||||
|
|
||||||
if(self::get($uid,$family,$key,null, true) === false) {
|
if(is_null(self::get($uid,$family,$key,null, true))) {
|
||||||
$a->config[$uid][$family][$key] = $value;
|
$a->config[$uid][$family][$key] = $value;
|
||||||
$ret = q("INSERT INTO `pconfig` ( `uid`, `cat`, `k`, `v` ) VALUES ( %d, '%s', '%s', '%s' ) ",
|
$ret = q("INSERT INTO `pconfig` ( `uid`, `cat`, `k`, `v` ) VALUES ( %d, '%s', '%s', '%s' ) ",
|
||||||
intval($uid),
|
intval($uid),
|
||||||
|
|
Loading…
Reference in a new issue